Scrutinizer Auto-Fixes

This commit consists of patches automatically generated for this project on https://scrutinizer-ci.com
pull/2487/head
Scrutinizer Auto-Fixer 8 years ago
parent 14194fde53
commit 7a56f3fbb3
  1. 18
      custompages/first_login-dist.php
  2. 6
      custompages/index-unlogged-dist.php
  3. 2
      custompages/loggedout-dist.php
  4. 4
      custompages/lostpassword-dist.php
  5. 2
      custompages/registration-dist.php
  6. 4
      custompages/registration-feedback-dist.php
  7. 2
      main/admin/cli.php
  8. 38
      main/admin/extra_fields.php
  9. 48
      main/admin/ldap_users_synchro.php
  10. 14
      main/admin/promotions.php
  11. 18
      main/admin/usergroup_user_import.php
  12. 2
      main/auth/external_login/ldap.inc.php
  13. 22
      main/auth/sso/sso.Drupal.class.php
  14. 8
      main/auth/sso/sso_server_test.php
  15. 14
      main/cron/course_finished.php
  16. 15
      main/cron/create_course_sessions.php
  17. 4
      main/cron/document/finddoc.php
  18. 2
      main/cron/fix_fill_blank.php
  19. 10
      main/cron/fix_online_time.php
  20. 4
      main/cron/hosting_total_size_limit.php
  21. 8
      main/cron/lang/check_parse_lang.php
  22. 26
      main/cron/lang/langstats_file_builder.php
  23. 28
      main/cron/lang/list_undefined_langvars.php
  24. 18
      main/cron/lang/list_unused_langvars.php
  25. 10
      main/cron/user_import/resend_email_with_new_password.php
  26. 6
      main/inc/lib/array.lib.php
  27. 36
      main/inc/lib/baker.lib.php
  28. 14
      main/inc/lib/custom_pages.class.php
  29. 28
      main/inc/lib/events_email.class.php
  30. 10
      main/inc/lib/export.lib.inc.php
  31. 2
      main/inc/lib/formvalidator/Element/DateRangePicker.php
  32. 6
      main/inc/lib/formvalidator/Rule/MultipleRequired.php
  33. 28
      main/inc/lib/hook/HookManagement.php
  34. 12
      main/inc/lib/login_redirection.class.php
  35. 12
      main/inc/lib/portfolio.class.php
  36. 12
      main/inc/lib/redirect.class.php
  37. 4
      main/inc/lib/rights.lib.php
  38. 12
      main/inc/lib/search/ChamiloQuery.php
  39. 2
      main/inc/lib/system/web/request.class.php
  40. 4
      main/inc/lib/table_sort.class.php
  41. 96
      main/permissions/roles.php
  42. 102
      main/session/session_category_add.php
  43. 16
      main/session/session_import.php
  44. 12
      main/survey/fillsurvey.php
  45. 6
      main/survey/survey_list.php
  46. 102
      main/webservices/access_url.php
  47. 14
      main/webservices/client_soap.php
  48. 2
      main/webservices/cm_soap.php
  49. 20
      main/webservices/cm_webservice_announcements.php
  50. 6
      main/webservices/cm_webservice_courses.php
  51. 30
      main/webservices/cm_webservice_inbox.php
  52. 2
      main/webservices/example_fill_users_fields.php
  53. 10
      main/webservices/http-auth.php
  54. 4
      main/webservices/soap.php
  55. 2
      main/webservices/testip.php
  56. 2
      main/webservices/user_import/service.php
  57. 50
      main/webservices/user_info.soap.php
  58. 14
      main/webservices/webservice.php
  59. 36
      main/webservices/webservice_report.php
  60. 2
      main/work/download_comment_file.php
  61. 88
      plugin/buycourses/src/paypalfunctions.php
  62. 28
      plugin/dashboard/block_course/block_course.class.php
  63. 38
      plugin/dashboard/block_evaluation_graph/block_evaluation_graph.class.php
  64. 8
      plugin/ext_auth_chamilo_logout_button_behaviour/plugin.php
  65. 2
      plugin/jcapture/plugin_applet.php
  66. 2
      plugin/kannelsms/config.php
  67. 7
      plugin/kannelsms/lib/kannelsms.lib.php
  68. 172
      plugin/openmeetings/lib/openmeetings_gateway.php
  69. 2
      plugin/resubscription/install.php

@ -11,17 +11,17 @@ require_once __DIR__.'/language.php';
/**
* Security checks
*/
if (! isset($_SESSION['conditional_login']['uid']))
if (!isset($_SESSION['conditional_login']['uid']))
die("Not Authorised");
if (isset($_POST['password'])) {
$u = api_get_user_info($_SESSION['conditional_login']['uid']);
if ($_POST['password'] != $_POST['password2']) {
header('Location: '. api_get_self().'?invalid=2');
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');
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'];
@ -97,23 +97,23 @@ $www = api_get_path('WEB_PATH');
<div id="header">
<img src="/custompages/images/header.png" alt="Logo" />
</div> <!-- #header -->
<h2> <?php echo custompages_get_lang('FirstLogin');?> </h2>
<h2> <?php echo custompages_get_lang('FirstLogin'); ?> </h2>
<div id="changepassword-form-box" class="form-box">
<div class="info"> <?php echo custompages_get_lang('FirstLoginChangePassword');?> </div>
<div class="info"> <?php echo custompages_get_lang('FirstLoginChangePassword'); ?> </div>
<?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 custompages_get_lang('Password');?></label>
<label for="password">*<?php echo custompages_get_lang('Password'); ?></label>
<input name="password" type="password" /><br />
<label for="password2">*<?php echo custompages_get_lang('Password');?></label>
<label for="password2">*<?php echo custompages_get_lang('Password'); ?></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 custompages_get_lang('LoginEnter');?></span>
<span><?php echo custompages_get_lang('LoginEnter'); ?></span>
</div> <!-- #form-submit -->
</div> <!-- #form -->
<div id="footer">

@ -87,14 +87,14 @@ $rootWeb = api_get_path('WEB_PATH');
?>
<form id="login-form" class="form" action="<?php echo api_get_path(WEB_PATH)?>index.php" method="post">
<div>
<label for="login">*<?php echo custompages_get_lang('User');?></label>
<label for="login">*<?php echo custompages_get_lang('User'); ?></label>
<input name="login" type="text" /><br />
<label for="password">*<?php echo custompages_get_lang('Password');?></label>
<label for="password">*<?php echo custompages_get_lang('Password'); ?></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 custompages_get_lang('LoginEnter');?></span>
<span><?php echo custompages_get_lang('LoginEnter'); ?></span>
</div> <!-- #form-submit -->
<div id="links">

@ -51,7 +51,7 @@ $www = api_get_path('WEB_PATH');
You have been logged out.
</div>
</div>
<a href="<?php echo $www . 'user_portal.php'; ?>">Go to your portal</a>
<a href="<?php echo $www.'user_portal.php'; ?>">Go to your portal</a>
<div id="footer">
<img src="<?php echo $www ?>/custompages/images/footer.png" alt="footer"/>
</div>

@ -12,7 +12,7 @@ $rootWeb = api_get_path('WEB_PATH');
?>
<html>
<head>
<title><?php echo custompages_get_lang('LostPassword');?></title>
<title><?php echo custompages_get_lang('LostPassword'); ?></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" />
@ -44,7 +44,7 @@ $rootWeb = api_get_path('WEB_PATH');
<div id="lostpassword-form-box" class="form-box">
<?php
if (isset($content['info']) && !empty($content['info'])) {
echo '<div id="registration-form-error" class="form-error"><ul>' . $content['info'] . '</ul></div>';
echo '<div id="registration-form-error" class="form-error"><ul>'.$content['info'].'</ul></div>';
}
echo isset($content['form']) ? $content['form'] : ''

@ -81,7 +81,7 @@ EOT;
?>
<html>
<head>
<title><?php echo custompages_get_lang('Registration');?></title>
<title><?php echo custompages_get_lang('Registration'); ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">

@ -14,7 +14,7 @@ $rootWeb = api_get_path('WEB_PATH');
?>
<html>
<head>
<title><?php echo custompages_get_lang('Registration');?></title>
<title><?php echo custompages_get_lang('Registration'); ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
@ -40,7 +40,7 @@ $rootWeb = api_get_path('WEB_PATH');
</div>
<div id="registration-form-box" class="form-box">
<div class="block-form-login">
<?php echo $content['info']; ?>
<?php echo $content['info']; ?>
</div>
</div>
<div id="footer">

@ -20,7 +20,7 @@ api_protect_admin_script();
// setting the name of the tool
$tool_name = get_lang('CommandLineInterpreter');
// setting breadcrumbs
$interbreadcrumb[] = array ('url' => 'index.php', 'name' => get_lang('PlatformAdmin'));
$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin'));
// including the header file (which includes the banner itself)
Display :: display_header($tool_name);
switch ($_GET["cmd"]) {

@ -36,7 +36,7 @@ $obj = new ExtraField($extraFieldType);
$obj->setupBreadcrumb($interbreadcrumb, $action);
//jqgrid will use this URL to do the selects
$url = api_get_path(WEB_AJAX_PATH) . 'model.ajax.php?a=get_extra_fields&type=' . $extraFieldType;
$url = api_get_path(WEB_AJAX_PATH).'model.ajax.php?a=get_extra_fields&type='.$extraFieldType;
//The order is important you need to check the the $column variable in the model.ajax.php file
$columns = $obj->getJqgridColumnNames();
@ -64,43 +64,43 @@ $(function() {
array(),
$action_links,
true
). '
).'
$("#field_type").on("change", function() {
id = $(this).val();
switch(id) {
case "1":
$("#example").html("' . addslashes(Display::return_icon('userfield_text.png')) . '");
$("#example").html("' . addslashes(Display::return_icon('userfield_text.png')).'");
break;
case "2":
$("#example").html("' . addslashes(Display::return_icon('userfield_text_area.png')) . '");
$("#example").html("' . addslashes(Display::return_icon('userfield_text_area.png')).'");
break;
case "3":
$("#example").html("' . addslashes(Display::return_icon('add_user_field_howto.png')) . '");
$("#example").html("' . addslashes(Display::return_icon('add_user_field_howto.png')).'");
break;
case "4":
$("#example").html("' . addslashes(Display::return_icon('userfield_drop_down.png')) . '");
$("#example").html("' . addslashes(Display::return_icon('userfield_drop_down.png')).'");
break;
case "5":
$("#example").html("' . addslashes(Display::return_icon('userfield_multidropdown.png')) . '");
$("#example").html("' . addslashes(Display::return_icon('userfield_multidropdown.png')).'");
break;
case "6":
$("#example").html("' . addslashes(Display::return_icon('userfield_data.png')) . '");
$("#example").html("' . addslashes(Display::return_icon('userfield_data.png')).'");
break;
case "7":
$("#example").html("' . addslashes(Display::return_icon('userfield_date_time.png')) . '");
$("#example").html("' . addslashes(Display::return_icon('userfield_date_time.png')).'");
break;
case "8":
$("#example").html("' . addslashes(Display::return_icon('userfield_doubleselect.png')) . '");
$("#example").html("' . addslashes(Display::return_icon('userfield_doubleselect.png')).'");
break;
case "9":
$("#example").html("' . addslashes(Display::return_icon('userfield_divider.png')) . '");
$("#example").html("' . addslashes(Display::return_icon('userfield_divider.png')).'");
break;
case "10":
$("#example").html("' . addslashes(Display::return_icon('userfield_user_tag.png')) . '");
$("#example").html("' . addslashes(Display::return_icon('userfield_user_tag.png')).'");
break;
case "11":
$("#example").html("' . addslashes(Display::return_icon('userfield_data.png')) . '");
$("#example").html("' . addslashes(Display::return_icon('userfield_data.png')).'");
break;
}
});
@ -118,7 +118,7 @@ switch ($action) {
) {
api_not_allowed();
}
$url = api_get_self() . '?type=' . $obj->type . '&action=' . Security::remove_XSS($_GET['action']);
$url = api_get_self().'?type='.$obj->type.'&action='.Security::remove_XSS($_GET['action']);
$form = $obj->return_form($url, 'add');
// The validation or display
@ -132,8 +132,8 @@ switch ($action) {
$obj->display();
} else {
echo '<div class="actions">';
echo '<a href="' . api_get_self() . '?type=' . $obj->type . '">' .
Display::return_icon('back.png', get_lang('Back'), '', ICON_SIZE_MEDIUM) . '</a>';
echo '<a href="'.api_get_self().'?type='.$obj->type.'">'.
Display::return_icon('back.png', get_lang('Back'), '', ICON_SIZE_MEDIUM).'</a>';
echo '</div>';
$form->addElement('hidden', 'sec_token');
$form->setConstants(array('sec_token' => $token));
@ -142,7 +142,7 @@ switch ($action) {
break;
case 'edit':
// Action handling: Editing
$url = api_get_self() . '?type=' . $obj->type . '&action=' . Security::remove_XSS($_GET['action']) . '&id=' . intval($_GET['id']);
$url = api_get_self().'?type='.$obj->type.'&action='.Security::remove_XSS($_GET['action']).'&id='.intval($_GET['id']);
$form = $obj->return_form($url, 'edit');
// The validation or display
@ -156,8 +156,8 @@ switch ($action) {
$obj->display();
} else {
echo '<div class="actions">';
echo '<a href="' . api_get_self() . '?type=' . $obj->type . '">' .
Display::return_icon('back.png', get_lang('Back'), '', ICON_SIZE_MEDIUM) . '</a>';
echo '<a href="'.api_get_self().'?type='.$obj->type.'">'.
Display::return_icon('back.png', get_lang('Back'), '', ICON_SIZE_MEDIUM).'</a>';
echo '</div>';
$form->addElement('hidden', 'sec_token');
$form->setConstants(array('sec_token' => $token));

@ -8,43 +8,43 @@
*/
exit(); //not yet functional, needs to be revised
$cidReset=true;
$cidReset = true;
require('../inc/global.inc.php');
$libpath = api_get_path(LIBRARY_PATH);
require("../auth/ldap/authldap.php");
$annee_base=date('Y');
$annee_base = date('Y');
// setting the section (for the tabs)
$this_section = SECTION_PLATFORM_ADMIN;
api_protect_admin_script();
// setting breadcrumbs
$interbreadcrumb[]=array('url' => 'index.php',"name" => get_lang('PlatformAdmin'));
$interbreadcrumb[]=array('url' => api_get_self(),"name" => get_lang('SessionsList'));
$interbreadcrumb[] = array('url' => 'index.php', "name" => get_lang('PlatformAdmin'));
$interbreadcrumb[] = array('url' => api_get_self(), "name" => get_lang('SessionsList'));
// Database Table Definitions
$tbl_session = Database::get_main_table(TABLE_MAIN_SESSION);
$tbl_session_rel_class = Database::get_main_table(TABLE_MAIN_SESSION_CLASS);
$tbl_session_rel_course = Database::get_main_table(TABLE_MAIN_SESSION_COURSE);
$tbl_session_rel_course_rel_user = Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER);
$tbl_course = Database::get_main_table(TABLE_MAIN_COURSE);
$tbl_user = Database::get_main_table(TABLE_MAIN_USER);
$tbl_session_rel_user = Database::get_main_table(TABLE_MAIN_SESSION_USER);
$tbl_class = Database::get_main_table(TABLE_MAIN_CLASS);
$tbl_class_user = Database::get_main_table(TABLE_MAIN_CLASS_USER);
$tbl_session_rel_class = Database::get_main_table(TABLE_MAIN_SESSION_CLASS);
$tbl_session_rel_course = Database::get_main_table(TABLE_MAIN_SESSION_COURSE);
$tbl_session_rel_course_rel_user = Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER);
$tbl_course = Database::get_main_table(TABLE_MAIN_COURSE);
$tbl_user = Database::get_main_table(TABLE_MAIN_USER);
$tbl_session_rel_user = Database::get_main_table(TABLE_MAIN_SESSION_USER);
$tbl_class = Database::get_main_table(TABLE_MAIN_CLASS);
$tbl_class_user = Database::get_main_table(TABLE_MAIN_CLASS_USER);
$tbl_session_rel_etape = "session_rel_etape";
$tbl_session_rel_etape = "session_rel_etape";
$id_session=intval($_GET['id_session']);
$id_session = intval($_GET['id_session']);
$formSent=0;
$errorMsg=$firstLetterUser=$firstLetterSession='';
$UserList=$SessionList=array();
$users=$sessions=array();
$noPHP_SELF=true;
$formSent = 0;
$errorMsg = $firstLetterUser = $firstLetterSession = '';
$UserList = $SessionList = array();
$users = $sessions = array();
$noPHP_SELF = true;
$page=intval($_GET['page']);
$action=$_REQUEST['action'];
$page = intval($_GET['page']);
$action = $_REQUEST['action'];
$tool_name = get_lang('Synchro LDAP : Import Etudiants/Etapes dans session');
Display::display_header($tool_name);
@ -59,10 +59,10 @@ Display::display_header($tool_name);
</form>
<?php
if (isset($action) && ($action=="synchro")) {
$included=true;
if (isset($action) && ($action == "synchro")) {
$included = true;
require('ldap_synchro.php');
Display :: display_normal_message($message,false);
Display :: display_normal_message($message, false);
}
Display::display_footer();
?>

@ -16,8 +16,8 @@ api_protect_admin_script();
$htmlHeadXtra[] = api_get_jqgrid_js();
// setting breadcrumbs
$interbreadcrumb[] = array('url' => 'index.php','name' => get_lang('PlatformAdmin'));
$interbreadcrumb[] = array('url' => 'career_dashboard.php','name' => get_lang('CareersAndPromotions'));
$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin'));
$interbreadcrumb[] = array('url' => 'career_dashboard.php', 'name' => get_lang('CareersAndPromotions'));
$action = isset($_GET['action']) ? $_GET['action'] : null;
@ -102,10 +102,10 @@ $extra_params['autowidth'] = 'true'; //use the width of the parent
$extra_params['height'] = 'auto'; //use the width of the parent
//With this function we can add actions to the jgrid
$action_links = 'function action_formatter (cellvalue, options, rowObject) {
return \'<a href="add_sessions_to_promotion.php?id=\'+options.rowId+\'">'.Display::return_icon('session_to_promotion.png',get_lang('SubscribeSessionsToPromotions'),'',ICON_SIZE_SMALL).'</a>'.
'&nbsp;<a href="?action=edit&id=\'+options.rowId+\'">'.Display::return_icon('edit.png',get_lang('Edit'),'',ICON_SIZE_SMALL).'</a>'.
'&nbsp;<a onclick="javascript:if(!confirm('."\'".addslashes(api_htmlentities(get_lang("ConfirmYourChoice"),ENT_QUOTES))."\'".')) return false;" href="?sec_token='.$token.'&action=copy&id=\'+options.rowId+\'">'.Display::return_icon('copy.png',get_lang('Copy'),'',ICON_SIZE_SMALL).'</a>'.
'&nbsp;<a onclick="javascript:if(!confirm('."\'".addslashes(api_htmlentities(get_lang("ConfirmYourChoice"),ENT_QUOTES))."\'".')) return false;" href="?sec_token='.$token.'&action=delete&id=\'+options.rowId+\'">'.Display::return_icon('delete.png',get_lang('Delete'),'',ICON_SIZE_SMALL).'</a> \';
return \'<a href="add_sessions_to_promotion.php?id=\'+options.rowId+\'">'.Display::return_icon('session_to_promotion.png', get_lang('SubscribeSessionsToPromotions'), '', ICON_SIZE_SMALL).'</a>'.
'&nbsp;<a href="?action=edit&id=\'+options.rowId+\'">'.Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_SMALL).'</a>'.
'&nbsp;<a onclick="javascript:if(!confirm('."\'".addslashes(api_htmlentities(get_lang("ConfirmYourChoice"), ENT_QUOTES))."\'".')) return false;" href="?sec_token='.$token.'&action=copy&id=\'+options.rowId+\'">'.Display::return_icon('copy.png', get_lang('Copy'), '', ICON_SIZE_SMALL).'</a>'.
'&nbsp;<a onclick="javascript:if(!confirm('."\'".addslashes(api_htmlentities(get_lang("ConfirmYourChoice"), ENT_QUOTES))."\'".')) return false;" href="?sec_token='.$token.'&action=delete&id=\'+options.rowId+\'">'.Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_SMALL).'</a> \';
}';
?>
@ -150,7 +150,7 @@ switch ($action) {
$promotion->display();
} else {
echo '<div class="actions">';
echo Display::url(Display::return_icon('back.png',get_lang('Back'),'',ICON_SIZE_MEDIUM), api_get_self());
echo Display::url(Display::return_icon('back.png', get_lang('Back'), '', ICON_SIZE_MEDIUM), api_get_self());
echo '</div>';
$form->addElement('hidden', 'sec_token');
$form->setConstants(array('sec_token' => $token));

@ -25,7 +25,7 @@ function validate_data($user_classes) {
foreach ($mandatory_fields as $field) {
if (!isset($user_class[$field]) || strlen($user_class[$field]) == 0) {
$user_class['error'] = get_lang($field . 'Mandatory');
$user_class['error'] = get_lang($field.'Mandatory');
$errors[] = $user_class;
}
}
@ -37,7 +37,7 @@ function validate_data($user_classes) {
// 2.1.1 Check whether code exists in DB
$exists = $usergroup->usergroup_exists($user_class['ClassName']);
if (!$exists) {
$user_class['error'] = get_lang('CodeDoesNotExists') . ': ' . $user_class['ClassName'];
$user_class['error'] = get_lang('CodeDoesNotExists').': '.$user_class['ClassName'];
$errors[] = $user_class;
} else {
$classcodes[$user_class['CourseCode']] = 1;
@ -49,14 +49,14 @@ function validate_data($user_classes) {
if (!UserManager::is_username_empty($user_class['UserName'])) {
// 3.1. Check whether username is too long.
if (UserManager::is_username_too_long($user_class['UserName'])) {
$user_class['error'] = get_lang('UserNameTooLong') . ': ' . $user_class['UserName'];
$user_class['error'] = get_lang('UserNameTooLong').': '.$user_class['UserName'];
$errors[] = $user_class;
}
$username = UserManager::purify_username($user_class['UserName'], $purification_option_for_usernames);
// 3.2. Check whether username exists.
if (UserManager::is_username_available($username)) {
$user_class['error'] = get_lang('UnknownUser') . ': ' . $username;
$user_class['error'] = get_lang('UnknownUser').': '.$username;
$errors[] = $user_class;
}
}
@ -105,8 +105,8 @@ function save_data($users_classes, $deleteUsersNotInList = false) {
$class_name = $user_data['class_name'];
$user_list_name = $user_data['user_list_name'];
$usergroup->subscribe_users_to_usergroup($class_id, $user_list, $deleteUsersNotInList);
$message .= Display::return_message(get_lang('Class') . ': ' . $class_name . '<br />', 'normal', false);
$message .= Display::return_message(get_lang('Users') . ': ' . implode(', ', $user_list_name));
$message .= Display::return_message(get_lang('Class').': '.$class_name.'<br />', 'normal', false);
$message .= Display::return_message(get_lang('Users').': '.implode(', ', $user_list_name));
}
}
return $message;
@ -128,7 +128,7 @@ require_once __DIR__.'/../inc/global.inc.php';
$this_section = SECTION_PLATFORM_ADMIN;
api_protect_admin_script(true);
$tool_name = get_lang('AddUsersToAClass') . ' CSV';
$tool_name = get_lang('AddUsersToAClass').' CSV';
$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin'));
$interbreadcrumb[] = array('url' => 'usergroups.php', 'name' => get_lang('Classes'));
@ -164,7 +164,7 @@ if (isset($return) && $return) {
if (count($errors) != 0) {
$error_message = "\n";
foreach ($errors as $index => $error_class_user) {
$error_message .= get_lang('Line') . ' ' . $error_class_user['line'] . ': ' . $error_class_user['error'] . '</b>';
$error_message .= get_lang('Line').' '.$error_class_user['line'].': '.$error_class_user['error'].'</b>';
$error_message .= "<br />";
}
$error_message .= "\n";
@ -172,7 +172,7 @@ if (count($errors) != 0) {
}
$form->display();
?>
<p><?php echo get_lang('CSVMustLookLike') . ' (' . get_lang('MandatoryFields') . ')'; ?> :</p>
<p><?php echo get_lang('CSVMustLookLike').' ('.get_lang('MandatoryFields').')'; ?> :</p>
<pre>
<b>UserName</b>;<b>ClassName</b>
jdoe;class01

@ -330,7 +330,7 @@ function extldap_add_user_by_array($data, $update_if_exists = true)
// TODO the password, if encrypted at the source, will be encrypted twice, which makes it useless. Try to fix that.
$passwordKey = isset($extldap_user_correspondance['password']) ? $extldap_user_correspondance['password'] : 'userPassword';
$password = $data[$passwordKey][0];
$password = $data[$passwordKey][0];
// To ease management, we add the step-year (etape-annee) code
//$official_code = $etape."-".$annee;

@ -22,11 +22,11 @@ use ChamiloSession as Session;
*/
class ssoDrupal
{
public $protocol; // 'http://',
public $domain; // 'localhost/project/drupal',
public $auth_uri; // '/?q=user',
public $protocol; // 'http://',
public $domain; // 'localhost/project/drupal',
public $auth_uri; // '/?q=user',
public $deauth_uri; // '/?q=logout',
public $referer; // http://my.chamilo.com/main/auth/profile.php
public $referer; // http://my.chamilo.com/main/auth/profile.php
/**
* Instanciates the object, initializing all relevant URL strings
@ -123,9 +123,9 @@ class ssoDrupal
&& ($sso['username'] == $uData['username'])) {
//Check if the account is active (not locked)
if ($uData['active']=='1') {
if ($uData['active'] == '1') {
// check if the expiration date has not been reached
if (empty($uData['expiration_date']) OR $uData['expiration_date'] > date('Y-m-d H:i:s') OR $uData['expiration_date']=='0000-00-00 00:00:00') {
if (empty($uData['expiration_date']) OR $uData['expiration_date'] > date('Y-m-d H:i:s') OR $uData['expiration_date'] == '0000-00-00 00:00:00') {
//If Multiple URL is enabled
if (api_get_multiple_access_url()) {
@ -158,11 +158,11 @@ class ssoDrupal
// the user credentials are OK, which
// should be protection enough
// against evil URL spoofing...
$sso_target = api_get_path(WEB_PATH) . base64_decode($sso['ruri']);
$sso_target = api_get_path(WEB_PATH).base64_decode($sso['ruri']);
} else {
$sso_target = isset($sso['target']) ? $sso['target'] : api_get_path(WEB_PATH) . 'index.php';
$sso_target = isset($sso['target']) ? $sso['target'] : api_get_path(WEB_PATH).'index.php';
}
header('Location: '. $sso_target);
header('Location: '.$sso_target);
exit;
} else {
// user does not have permission for this site
@ -279,12 +279,12 @@ class ssoDrupal
// If this is an administrator, allow him to make some changes in
// the Chamilo profile
if ($asAdmin && api_is_platform_admin(true)) {
return api_get_path(WEB_CODE_PATH) . "admin/user_edit.php?user_id=$userId";
return api_get_path(WEB_CODE_PATH)."admin/user_edit.php?user_id=$userId";
}
// If the user doesn't match a Drupal user, give the normal profile
// link
if ($drupalUserIdData === false) {
return api_get_path(WEB_CODE_PATH) . 'auth/profile.php';
return api_get_path(WEB_CODE_PATH).'auth/profile.php';
}
// In all other cases, generate a link to the Drupal profile edition
$drupalUserId = $drupalUserIdData['value'];

@ -48,7 +48,7 @@ if (isset($_POST['user']) && isset($_POST['password'])) {
/* 2.Get the chamilo username and password from your system or from webservices */
$account['username'] = 'jbrion525'; //username in Chamilo
$account['username'] = 'jbrion525'; //username in Chamilo
$account['password'] = sha1(sha1('jbrion525')); //encrypted password with assuming that the first encrypted method is sha1 in chamilo
$master_auth_uri = $my_chamilo_server.'/?q=user';
@ -64,9 +64,9 @@ if (isset($_POST['user']) && isset($_POST['password'])) {
);
$cookie = base64_encode(serialize($sso));
$url = chamilo_sso_protocol() . $master_auth_uri;
$params = 'sso_referer='. urlencode($url) .'&sso_cookie='. urlencode($cookie);
$final_url = filter_xss($_GET['sso_referer']) .'?'. $params;
$url = chamilo_sso_protocol().$master_auth_uri;
$params = 'sso_referer='.urlencode($url).'&sso_cookie='.urlencode($cookie);
$final_url = filter_xss($_GET['sso_referer']).'?'.$params;
//If your user exists redirect to chamilo and set the account in a session to check it later
$_SESSION['my_server_user_session'] = $account;

@ -6,7 +6,7 @@
* @author Angel Fernando Quiroz Campos <angel.quiroz@beeznest.com>
* @package chamilo.cron
*/
require_once __DIR__ . '/../inc/global.inc.php';
require_once __DIR__.'/../inc/global.inc.php';
if (php_sapi_name() != 'cli') {
exit; //do not run from browser
@ -32,7 +32,7 @@ $sessions = $sessionRepo->createQueryBuilder('s')
->getResult();
if (empty($sessions)) {
echo "No sessions finishing today $endDate" . PHP_EOL;
echo "No sessions finishing today $endDate".PHP_EOL;
exit;
}
@ -50,7 +50,7 @@ foreach ($sessions as $session) {
$sessionUsers = $session->getUsers();
if (empty($sessionUsers)) {
echo 'No users to send mail' . PHP_EOL;
echo 'No users to send mail'.PHP_EOL;
exit;
}
@ -81,9 +81,9 @@ foreach ($sessions as $session) {
$administrator['email']
);
echo '============' . PHP_EOL;
echo "Email sent to: {$user->getCompleteName()} ({$user->getEmail()})" . PHP_EOL;
echo "Session: {$session->getName()}" . PHP_EOL;
echo "End date: {$session->getAccessEndDate()->format('Y-m-d h:i')}" . PHP_EOL;
echo '============'.PHP_EOL;
echo "Email sent to: {$user->getCompleteName()} ({$user->getEmail()})".PHP_EOL;
echo "Session: {$session->getName()}".PHP_EOL;
echo "End date: {$session->getAccessEndDate()->format('Y-m-d h:i')}".PHP_EOL;
}
}

@ -14,7 +14,7 @@ if (php_sapi_name() != 'cli') {
exit; //do not run from browser
}
require_once __DIR__ . "/../inc/global.inc.php";
require_once __DIR__."/../inc/global.inc.php";
// First day of the current month to create sessions and add courses for the next month (e.g. "07")
define("OFFSET", "15");
@ -41,7 +41,7 @@ function getQuarterFirstAndLastDates($initialDate = null)
{
$startDate = $initialDate ? $initialDate : date("Y-m-01");
$month = getQuarterFirstMonth(getQuarter(date('m', $startDate)));
$startDate = substr($startDate, 0, 5) . $month . '-01';
$startDate = substr($startDate, 0, 5).$month.'-01';
$nextQuarterStartDate = date('Y-m-d', api_strtotime($startDate.' + 3 month'));
$endDate = date('Y-m-d', api_strtotime($nextQuarterStartDate.' - 1 minute'));
return array('startDate' => $startDate, 'endDate' => $endDate);
@ -148,8 +148,7 @@ function createCourseSessions($courses, $administratorId, $startDate, $endDate)
{
echo "\n";
echo $courses ?
"Creating sessions and adding courses for the period between ".$startDate." and ".$endDate :
"Every course is already in session for the period between ".$startDate." and ".$endDate;
"Creating sessions and adding courses for the period between ".$startDate." and ".$endDate : "Every course is already in session for the period between ".$startDate." and ".$endDate;
echo "\n=====================================================================================\n\n";
// Loop through courses creating one session per each and adding them
foreach ($courses as $course) {
@ -158,8 +157,8 @@ function createCourseSessions($courses, $administratorId, $startDate, $endDate)
$year = date("Y", api_strtotime($startDate));
$quarter = getQuarter($month);
$quarter = getQuarterRoman($quarter);
$period = $year . '-' . $quarter;
$sessionName = '[' . $period . '] ' . $course['title'];
$period = $year.'-'.$quarter;
$sessionName = '['.$period.'] '.$course['title'];
$sessionId = SessionManager::create_session(
$sessionName,
$startDate,
@ -178,7 +177,7 @@ function createCourseSessions($courses, $administratorId, $startDate, $endDate)
}
// Starts the script
echo "Starting process..." . PHP_EOL;
echo "Starting process...".PHP_EOL;
// Get first active administrator
$administrators = array_reverse(UserManager::get_all_administrators());
$lastingAdministrators = count($administrators);
@ -199,7 +198,7 @@ createCourseSessions($courses, $administratorId, $dates['startDate'], $dates['en
// Creates course sessions for the following month
$offsetDay = intval(substr($dates['endDate'], 8, 2)) - OFFSET;
if (date("Y-m-d") >= date(substr($dates['endDate'], 0, 8) . $offsetDay)) {
if (date("Y-m-d") >= date(substr($dates['endDate'], 0, 8).$offsetDay)) {
$dates = getQuarterFirstAndLastDates(date("Y-m-d", api_strtotime(date("Y-m-01")." + 3 month")));
// Get courses that don't have any session the next month
$courses = CourseManager::getCoursesWithoutSession($dates['startDate'], $dates['endDate']);

@ -12,13 +12,13 @@ if (empty($_GET['doc'])) {
} else {
echo "Received param ".Security::remove_XSS($_GET['doc'])."<br />";
}
$courses_list = CourseManager::get_courses_list();
$courses_list = CourseManager::get_courses_list();
foreach ($courses_list as $course) {
$title = Database::escape_string($_GET['doc']);
$td = Database::get_course_table(TABLE_DOCUMENT);
$sql = "SELECT id, path FROM $td WHERE c_id = ".$course['id']." AND path LIKE '%$title%' OR title LIKE '%$title%'";
$res = Database::query($sql);
if (Database::num_rows($res)>0) {
if (Database::num_rows($res) > 0) {
while ($row = Database::fetch_array($res)) {
echo "Found doc ".$row['id']."-> ".$row['path']." in course ".$course['code']."<br />";
}

@ -9,7 +9,7 @@ $table = Database::get_course_table(TABLE_QUIZ_ANSWER);
$execute = isset($_GET['execute']) ? $_GET['execute'] : null;
$courseId = isset($_GET['c_id']) ? $_GET['c_id'] : null;
$questionId = isset($_GET['question_id']) ? $_GET['question_id'] : null;
$questionId = isset($_GET['question_id']) ? $_GET['question_id'] : null;
$sql2 = "SELECT * FROM $table WHERE answer LIKE '%[%]%'";

@ -6,7 +6,7 @@
* @package chamilo.cron
* @author Imanol Losada <imanol.losada@beeznest.com>
*/
require_once __DIR__ . '/../inc/global.inc.php';
require_once __DIR__.'/../inc/global.inc.php';
/**
* Get ids of COURSEMANAGERs that are inside a course right now
@ -15,9 +15,9 @@ require_once __DIR__ . '/../inc/global.inc.php';
function getTeachersInCourseIds()
{
$table = Database::get_main_table(TABLE_STATISTIC_TRACK_E_ONLINE);
$joinStatement = ' JOIN ' . Database::get_main_table(TABLE_MAIN_USER) . ' ON login_user_id = user_id';
$joinStatement = ' JOIN '.Database::get_main_table(TABLE_MAIN_USER).' ON login_user_id = user_id';
return Database::select(
'login_user_id', $table . $joinStatement,
'login_user_id', $table.$joinStatement,
array(
'where' => array(
'c_id IS NOT NULL AND status = ?' => array(
@ -44,7 +44,7 @@ function updateTeachersInCourseIdleForTimeLimit($teachersInCourseIds)
$dataBaseCurrentHour = array_shift($utcResult);
$maximumIdleTimeInCourse = date(
'Y-m-d H:i:s',
strtotime($dataBaseCurrentHour . ' ' . $timeLimit)
strtotime($dataBaseCurrentHour.' '.$timeLimit)
);
$table = Database::get_main_table(TABLE_STATISTIC_TRACK_E_COURSE_ACCESS);
$onLineTrackTable = Database::get_main_table(TABLE_STATISTIC_TRACK_E_ONLINE);
@ -69,7 +69,7 @@ function updateTeachersInCourseIdleForTimeLimit($teachersInCourseIds)
array(
'logout_course_date' => date(
'Y-m-d H:i:s',
strtotime($currentTeacherData['logout_course_date'] . ' ' . $extraTime)
strtotime($currentTeacherData['logout_course_date'].' '.$extraTime)
)
),
array(

@ -97,7 +97,7 @@ function calculateTotalPortalSize($debug)
$totalSize = $row['total'];
if ($debug) {
echo "Total size in table $table " . (round($totalSize / 1024)) . " MB \n";
echo "Total size in table $table ".(round($totalSize / 1024))." MB \n";
}
$table = Database::get_course_table(TABLE_FORUM_ATTACHMENT);
@ -107,7 +107,7 @@ function calculateTotalPortalSize($debug)
$subTotal = $row['total'];
$totalSize += $subTotal;
if ($debug) {
echo "Total size in table $table " . (round($subTotal / 1024)) . " MB \n";
echo "Total size in table $table ".(round($subTotal / 1024))." MB \n";
}
$totalSize = $totalSize / 1024;

@ -9,7 +9,7 @@
//die();
require_once '../../inc/global.inc.php';
$path = api_get_path(SYS_LANG_PATH).'english';
ini_set('memory_limit','128M');
ini_set('memory_limit', '128M');
/**
* Main code
*/
@ -18,7 +18,7 @@ $list = SubLanguageManager::get_lang_folder_files_list($path);
$langs = scandir(api_get_path(SYS_LANG_PATH));
foreach ($langs as $lang) {
$dir = api_get_path(SYS_LANG_PATH).$lang;
if (is_dir($dir) && substr($lang,0,1) != '.' && !empty($lang)) {
if (is_dir($dir) && substr($lang, 0, 1) != '.' && !empty($lang)) {
echo "$lang...";
$ok = true;
foreach ($list as $entry) {
@ -26,8 +26,8 @@ foreach ($langs as $lang) {
$out = array();
if (is_file($file)) {
//$terms = array_merge($terms,SubLanguageManager::get_all_language_variable_in_file($file,true));
@exec('php5 -l '.$file,$out);
if (substr($out[0],0,2)!='No') {
@exec('php5 -l '.$file, $out);
if (substr($out[0], 0, 2) != 'No') {
echo $out[0]."\n";
$ok = false;
}

@ -34,7 +34,7 @@ $arch_dir = api_get_path(SYS_ARCHIVE_PATH);
*/
foreach ($terms as $row) {
if ($words_counter > 10000) { break; }
$words = str_word_count(get_lang($row['term_name'],null,$orig_lang));
$words = str_word_count(get_lang($row['term_name'], null, $orig_lang));
$words_counter += $words;
$terms_in_limit[$row['term_name']] = $i;
//echo "Term <b>".$row['term_name']."</b> is <b>'".get_lang($row['term_name'],null,$orig_lang)."'</b> which means $words words<br /><br />\n";
@ -59,37 +59,37 @@ $words_found = 0;
$global_var = array(); //keep the combination of all vars
$terms_in_limit = array_flip($terms_in_limit);
foreach ($list_files as $file) {
if (substr($file,0,1) == '.') {continue;}
if (substr($file, 0, 1) == '.') {continue; }
//echo "'".substr($file,0,-8)."',<br />"; //print in a PHP array format
$vars = file($lang_dir.'/'.$orig_lang.'/'.$file);
$local_var = array();
$file_string = '<?php'."\n";
foreach ($vars as $line) {
$var = array();
$res = preg_match('/^(\$\w*)/',$line,$var);
if ($res>0) {
$res = preg_match('/^(\$\w*)/', $line, $var);
if ($res > 0) {
//echo $var[1]."<br />";
if (in_array(substr($var[1],1),$terms_in_limit)) {
if (in_array(substr($var[1], 1), $terms_in_limit)) {
//echo "Var ".$var[1]." was in the limit<br />";
$local_var[$var[1]] = $line;
$file_string .= $line;
$terms_found[] = substr($var[1],1); //e.g. store Tools
$words_found += str_word_count(get_lang($var[1],null,$orig_lang));
} elseif (in_array(substr($var[1],5),$terms_in_limit)) {
$terms_found[] = substr($var[1], 1); //e.g. store Tools
$words_found += str_word_count(get_lang($var[1], null, $orig_lang));
} elseif (in_array(substr($var[1], 5), $terms_in_limit)) {
//echo "Var ".$var[1]." was in the limit<br />";
$local_var[$var[1]] = $line;
$file_string .= $line;
$terms_found[] = substr($var[1],5); //e.g. store langTools
$words_found += str_word_count(get_lang(substr($var[1],5),null,$orig_lang));
$terms_found[] = substr($var[1], 5); //e.g. store langTools
$words_found += str_word_count(get_lang(substr($var[1], 5), null, $orig_lang));
} //else do not care
}
}
echo "Writing ".$arch_dir.'/langstats/'.$orig_lang.'/'.$file."<br />\n";
file_put_contents($arch_dir.'/langstats/'.$orig_lang.'/'.$file,$file_string);
file_put_contents($arch_dir.'/langstats/'.$orig_lang.'/'.$file, $file_string);
$global_var += $local_var;
};
$terms_diff = count($global_var)-count($terms_in_limit);
$terms_diff = count($global_var) - count($terms_in_limit);
echo count($global_var)." terms found in English files (summing up to $words_found words). Some terms ($terms_diff in this case) might have appeared in two different files<br />";
/**
* Display results
@ -97,5 +97,5 @@ echo count($global_var)." terms found in English files (summing up to $words_fou
echo "Difference between filtered and found in English:<br />";
//print_r($terms_found);
echo "<pre>".print_r(array_diff($terms_in_limit,$terms_found),1)."</pre>";
echo "<pre>".print_r(array_diff($terms_in_limit, $terms_found), 1)."</pre>";
echo "#";

@ -9,7 +9,7 @@
die();
require_once '../../inc/global.inc.php';
$path = api_get_path(SYS_LANG_PATH).'english';
ini_set('memory_limit','128M');
ini_set('memory_limit', '128M');
/**
* Main code
*/
@ -18,7 +18,7 @@ $list = SubLanguageManager::get_lang_folder_files_list($path);
foreach ($list as $entry) {
$file = $path.'/'.$entry;
if (is_file($file)) {
$terms = array_merge($terms,SubLanguageManager::get_all_language_variable_in_file($file,true));
$terms = array_merge($terms, SubLanguageManager::get_all_language_variable_in_file($file, true));
}
}
// get only the array keys (the language variables defined in language files)
@ -31,13 +31,13 @@ $l = strlen(api_get_path(SYS_PATH));
$files = get_all_php_files(api_get_path(SYS_PATH));
foreach ($files as $file) {
//echo 'Analyzing '.$file."<br />";
$shortfile = substr($file,$l);
$shortfile = substr($file, $l);
$lines = file($file);
foreach ($lines as $line) {
$myterms = array();
$res = preg_match_all('/get_lang\(\'(\\w*)\'\)/',$line,$myterms);
$res = preg_match_all('/get_lang\(\'(\\w*)\'\)/', $line, $myterms);
if ($res > 0) {
foreach($myterms[1] as $term) {
foreach ($myterms[1] as $term) {
if (!isset($defined_terms[$term]) && !isset($defined_terms['lang'.$term])) {
$undefined_terms[$term] = $shortfile;
//echo "Undefined: $term<br />";
@ -45,9 +45,9 @@ foreach ($files as $file) {
}
}
$res = 0;
$res = preg_match_all('/\{[\'"](\\w*)[\'"]\|get_lang\}/',$line,$myterms);
$res = preg_match_all('/\{[\'"](\\w*)[\'"]\|get_lang\}/', $line, $myterms);
if ($res > 0) {
foreach($myterms[1] as $term) {
foreach ($myterms[1] as $term) {
if (!isset($defined_terms[$term]) && !isset($defined_terms['lang'.$term])) {
$undefined_terms[$term] = $shortfile;
//echo "Undefined: $term<br />";
@ -58,10 +58,10 @@ foreach ($files as $file) {
flush();
}
//$undefined_terms = array_flip($undefined_terms);
if (count($undefined_terms)<1) { die("No missing terms<br />\n"); } else { echo "The following terms were nowhere to be found: <br />\n<table>"; }
if (count($undefined_terms) < 1) { die("No missing terms<br />\n"); } else { echo "The following terms were nowhere to be found: <br />\n<table>"; }
foreach ($undefined_terms as $term => $file) {
echo "<tr><td>$term</td><td>in $file";
if (substr($file,0,7)=='plugin/') {
if (substr($file, 0, 7) == 'plugin/') {
echo " <span style=\"color: #00ff00;\">(this one should be taken care of by the plugin's language files)</span>";
}
echo "</td></tr>\n";
@ -73,14 +73,14 @@ function get_all_php_files($base_path) {
$list = scandir($base_path);
$files = array();
foreach ($list as $item) {
if (substr($item,0,1)=='.') {continue;}
$special_dirs = array(api_get_path(SYS_TEST_PATH),api_get_path(SYS_COURSE_PATH),api_get_path(SYS_LANG_PATH),api_get_path(SYS_ARCHIVE_PATH));
if (in_array($base_path.$item.'/',$special_dirs)) {continue;}
if (substr($item, 0, 1) == '.') {continue; }
$special_dirs = array(api_get_path(SYS_TEST_PATH), api_get_path(SYS_COURSE_PATH), api_get_path(SYS_LANG_PATH), api_get_path(SYS_ARCHIVE_PATH));
if (in_array($base_path.$item.'/', $special_dirs)) {continue; }
if (is_dir($base_path.$item)) {
$files = array_merge($files,get_all_php_files($base_path.$item.'/'));
$files = array_merge($files, get_all_php_files($base_path.$item.'/'));
} else {
//only analyse php files
$sub = substr($item,-4);
$sub = substr($item, -4);
if ($sub == '.php' or $sub == '.tpl') {
$files[] = $base_path.$item;
}

@ -43,7 +43,7 @@ foreach ($files as $file) {
$res = preg_match_all('/get_lang\(\'(\\w*)\'\)/', $line, $myTerms);
if ($res > 0) {
foreach ($myTerms[1] as $term) {
if (substr($term, 0, 4)=='lang') {
if (substr($term, 0, 4) == 'lang') {
$term = substr($term, 4);
}
$usedTerms[$term] = $shortFile;
@ -53,7 +53,7 @@ foreach ($files as $file) {
$res = preg_match_all('/\{[\'"](\\w*)[\'"]\|get_lang\}/', $line, $myTerms);
if ($res > 0) {
foreach ($myTerms[1] as $term) {
if (substr($term, 0, 4)=='lang') {
if (substr($term, 0, 4) == 'lang') {
$term = substr($term, 4);
}
$usedTerms[$term] = $shortFile;
@ -67,7 +67,7 @@ foreach ($files as $file) {
// Compare defined terms VS used terms. Used terms should be smaller than
// defined terms, and this should prove the concept that there are much
// more variables than what we really use
if (count($usedTerms)<1) {
if (count($usedTerms) < 1) {
die("No used terms<br />\n");
} else {
echo "The following terms were defined but never used: <br />\n<table>";
@ -75,7 +75,7 @@ if (count($usedTerms)<1) {
$i = 1;
foreach ($defined_terms as $term => $file) {
// remove "lang" prefix just in case
if (substr($term,0,4)=='lang') { $term = substr($term,4); }
if (substr($term, 0, 4) == 'lang') { $term = substr($term, 4); }
if (!isset($usedTerms[$term])) {
echo "<tr><td>$i</td><td>$term</td></tr>\n";
$i++;
@ -88,14 +88,14 @@ function get_all_php_files($base_path) {
$list = scandir($base_path);
$files = array();
foreach ($list as $item) {
if (substr($item,0,1)=='.') {continue;}
$special_dirs = array(api_get_path(SYS_TEST_PATH),api_get_path(SYS_COURSE_PATH),api_get_path(SYS_LANG_PATH),api_get_path(SYS_ARCHIVE_PATH));
if (in_array($base_path.$item.'/',$special_dirs)) {continue;}
if (substr($item, 0, 1) == '.') {continue; }
$special_dirs = array(api_get_path(SYS_TEST_PATH), api_get_path(SYS_COURSE_PATH), api_get_path(SYS_LANG_PATH), api_get_path(SYS_ARCHIVE_PATH));
if (in_array($base_path.$item.'/', $special_dirs)) {continue; }
if (is_dir($base_path.$item)) {
$files = array_merge($files,get_all_php_files($base_path.$item.'/'));
$files = array_merge($files, get_all_php_files($base_path.$item.'/'));
} else {
//only analyse php files
$sub = substr($item,-4);
$sub = substr($item, -4);
if ($sub == '.php' or $sub == '.tpl') {
$files[] = $base_path.$item;
}

@ -34,13 +34,13 @@ foreach ($list as $mail) {
FROM $users WHERE email = '$mail'\n";
$res = Database::query($sql);
if ($res === false) {
echo 'Error in database with email ' . $mail . "\n";
echo 'Error in database with email '.$mail."\n";
}
if (Database::num_rows($res) == 0) {
echo '[Error] Email not found in database: ' . $row['email'] . "\n";
echo '[Error] Email not found in database: '.$row['email']."\n";
} else {
$row = Database::fetch_assoc($res);
$pass = api_substr($row['username'], 0, 4) . rand(0, 9) . rand(0, 9);
$pass = api_substr($row['username'], 0, 4).rand(0, 9).rand(0, 9);
if ($user) {
@ -71,8 +71,8 @@ foreach ($list as $mail) {
null,
PERSON_NAME_EMAIL_ADDRESS
);
$emailsubject = '[' . api_get_setting('siteName') . '] ' . get_lang('YourReg', null, $l) . ' ' . api_get_setting('siteName');
$emailbody = get_lang('Dear', null, $l) . ' ' . api_get_person_name($user['FirstName'], $user['LastName']) . ",\n\n" . get_lang('YouAreReg', null, $l) . " " . api_get_setting('siteName') . " " . get_lang('WithTheFollowingSettings', null, $l) . "\n\n" . get_lang('Username', null, $l) . " : " . $user['UserName'] . "\n" . get_lang('Pass', null, $l) . " : " . $user['Password'] . "\n\n" . get_lang('Address', null, $l) . " " . api_get_setting('siteName') . " " . get_lang('Is', null, $l) . " : " . api_get_path(WEB_PATH) . " \n\n" . get_lang('Problem', null, $l) . "\n\n" . get_lang('Formula', null, $l) . ",\n\n" . api_get_person_name(api_get_setting('administratorName'), api_get_setting('administratorSurname')) . "\n" . get_lang('Manager', null, $l) . " " . api_get_setting('siteName') . "\nT. " . api_get_setting('administratorTelephone') . "\n" . get_lang('Email', null, $l) . " : " . api_get_setting('emailAdministrator') . "";
$emailsubject = '['.api_get_setting('siteName').'] '.get_lang('YourReg', null, $l).' '.api_get_setting('siteName');
$emailbody = get_lang('Dear', null, $l).' '.api_get_person_name($user['FirstName'], $user['LastName']).",\n\n".get_lang('YouAreReg', null, $l)." ".api_get_setting('siteName')." ".get_lang('WithTheFollowingSettings', null, $l)."\n\n".get_lang('Username', null, $l)." : ".$user['UserName']."\n".get_lang('Pass', null, $l)." : ".$user['Password']."\n\n".get_lang('Address', null, $l)." ".api_get_setting('siteName')." ".get_lang('Is', null, $l)." : ".api_get_path(WEB_PATH)." \n\n".get_lang('Problem', null, $l)."\n\n".get_lang('Formula', null, $l).",\n\n".api_get_person_name(api_get_setting('administratorName'), api_get_setting('administratorSurname'))."\n".get_lang('Manager', null, $l)." ".api_get_setting('siteName')."\nT. ".api_get_setting('administratorTelephone')."\n".get_lang('Email', null, $l)." : ".api_get_setting('emailAdministrator')."";
$sender_name = api_get_person_name(api_get_setting('administratorName'), api_get_setting('administratorSurname'), null, PERSON_NAME_EMAIL_ADDRESS);
$email_admin = api_get_setting('emailAdministrator');
@api_mail_html(

@ -110,10 +110,10 @@ function utf8_sort($array)
{
$old_locale = setlocale(LC_ALL, null);
$code = api_get_language_isocode();
$locale_list = array($code.'.utf8', 'en.utf8','en_US.utf8','en_GB.utf8');
$locale_list = array($code.'.utf8', 'en.utf8', 'en_US.utf8', 'en_GB.utf8');
$try_sort = false;
foreach($locale_list as $locale) {
foreach ($locale_list as $locale) {
$my_local = setlocale(LC_COLLATE, $locale);
if ($my_local) {
$try_sort = true;
@ -151,7 +151,7 @@ function array_flatten(array $array)
$flatten = array();
array_walk_recursive(
$array,
function ($value) use (&$flatten) {
function($value) use (&$flatten) {
$flatten[] = $value;
}
);

@ -51,7 +51,7 @@ class PNGImageBaker
foreach (array_keys($this->_chunks[$type]) as $typekey) {
list($key, $data) = explode("\0", $this->_chunks[$type][$typekey]);
if (strcmp($key, $check) == 0) {
echo 'Key "' . $check . '" already exists in "' . $type . '" chunk.';
echo 'Key "'.$check.'" already exists in "'.$type.'" chunk.';
return false;
}
}
@ -70,11 +70,11 @@ class PNGImageBaker
*/
public function addChunk($chunkType, $key, $value) {
$chunkData = $key . "\0" . $value;
$crc = pack("N", crc32($chunkType . $chunkData));
$chunkData = $key."\0".$value;
$crc = pack("N", crc32($chunkType.$chunkData));
$len = pack("N", strlen($chunkData));
$newChunk = $len . $chunkType . $chunkData . $crc;
$newChunk = $len.$chunkType.$chunkData.$crc;
$result = substr($this->_contents, 0, $this->_size - 12)
. $newChunk
. substr($this->_contents, $this->_size - 12, 12);
@ -92,30 +92,30 @@ class PNGImageBaker
*/
public function removeChunks($chunkType, $key, $png) {
// Read the magic bytes and verify
$retval = substr($png,0,8);
$retval = substr($png, 0, 8);
$ipos = 8;
if ($retval != "\x89PNG\x0d\x0a\x1a\x0a")
throw new Exception('Is not a valid PNG image');
// Loop through the chunks. Byte 0-3 is length, Byte 4-7 is type
$chunkHeader = substr($png,$ipos,8);
$chunkHeader = substr($png, $ipos, 8);
$ipos = $ipos + 8;
while ($chunkHeader) {
// Extract length and type from binary data
$chunk = @unpack('Nsize/a4type', $chunkHeader);
$skip = false;
if ( $chunk['type'] == $chunkType ) {
$data = substr($png,$ipos,$chunk['size']);
if ($chunk['type'] == $chunkType) {
$data = substr($png, $ipos, $chunk['size']);
$sections = explode("\0", $data);
print_r($sections);
if ( $sections[0] == $key ) $skip = true;
if ($sections[0] == $key) $skip = true;
}
// Extract the data and the CRC
$data = substr($png,$ipos,$chunk['size']+4);
$data = substr($png, $ipos, $chunk['size'] + 4);
$ipos = $ipos + $chunk['size'] + 4;
// Add in the header, data, and CRC
if ( ! $skip ) $retval = $retval . $chunkHeader . $data;
if (!$skip) $retval = $retval.$chunkHeader.$data;
// Read next chunk header
$chunkHeader = substr($png,$ipos,8);
$chunkHeader = substr($png, $ipos, 8);
$ipos = $ipos + 8;
}
return $retval;
@ -131,34 +131,34 @@ class PNGImageBaker
* If there is PNG information that matches the key an array is returned
*
*/
public function extractBadgeInfo($png, $key='openbadges') {
public function extractBadgeInfo($png, $key = 'openbadges') {
// Read the magic bytes and verify
$retval = substr($png,0,8);
$retval = substr($png, 0, 8);
$ipos = 8;
if ($retval != "\x89PNG\x0d\x0a\x1a\x0a") {
return false;
}
// Loop through the chunks. Byte 0-3 is length, Byte 4-7 is type
$chunkHeader = substr($png,$ipos,8);
$chunkHeader = substr($png, $ipos, 8);
$ipos = $ipos + 8;
while ($chunkHeader) {
// Extract length and type from binary data
$chunk = @unpack('Nsize/a4type', $chunkHeader);
$skip = false;
if ($chunk['type'] == 'tEXt') {
$data = substr($png,$ipos,$chunk['size']);
$data = substr($png, $ipos, $chunk['size']);
$sections = explode("\0", $data);
if ($sections[0] == $key) {
return $sections;
}
}
// Extract the data and the CRC
$data = substr($png,$ipos,$chunk['size']+4);
$data = substr($png, $ipos, $chunk['size'] + 4);
$ipos = $ipos + $chunk['size'] + 4;
// Read next chunk header
$chunkHeader = substr($png,$ipos,8);
$chunkHeader = substr($png, $ipos, 8);
$ipos = $ipos + 8;
}
}

@ -35,7 +35,7 @@ class CustomPages
*/
public static function path($name = '')
{
return api_get_path(SYS_PATH) . 'custompages/' . $name;
return api_get_path(SYS_PATH).'custompages/'.$name;
}
/**
@ -50,12 +50,12 @@ class CustomPages
return false;
}
$file = self::path($page_name . '.php');
$file = self::path($page_name.'.php');
if (file_exists($file)) {
include($file);
exit;
} else {
error_log('CustomPages::displayPage : could not read file ' . $file);
error_log('CustomPages::displayPage : could not read file '.$file);
}
}
@ -69,14 +69,14 @@ class CustomPages
public static function getURLImages($url_id = null)
{
if (is_null($url_id)) {
$url = 'http://' . $_SERVER['HTTP_HOST'] . '/';
$url = 'http://'.$_SERVER['HTTP_HOST'].'/';
$url_id = UrlManager::get_url_id($url);
}
$url_images_dir = api_get_path(SYS_PATH) . 'custompages/url-images/';
$url_images_dir = api_get_path(SYS_PATH).'custompages/url-images/';
$images = array();
for ($img_id = 1; $img_id <= 3; $img_id++) {
if (file_exists($url_images_dir . $url_id . '_url_image_' . $img_id . '.png')) {
$images[] = api_get_path(WEB_PATH) . 'custompages/url-images/' . $url_id . '_url_image_' . $img_id . '.png';
if (file_exists($url_images_dir.$url_id.'_url_image_'.$img_id.'.png')) {
$images[] = api_get_path(WEB_PATH).'custompages/url-images/'.$url_id.'_url_image_'.$img_id.'.png';
}
}

@ -123,7 +123,7 @@ class EventsMail
// If the mail only need to be send once (we know that thanks to the events.conf), we log it in the table
if ($event_config[$event_name]["sending_mail_once"]) {
$sql = 'INSERT INTO ' . Database::get_main_table(TABLE_EVENT_SENT) . ' (user_from, user_to, event_type_name)
$sql = 'INSERT INTO '.Database::get_main_table(TABLE_EVENT_SENT).' (user_from, user_to, event_type_name)
VALUES ('.$event_data["user_id"].', '.$id.' ,"'.Database::escape_string($event_name).'")
';
Database::query($sql);
@ -134,9 +134,9 @@ class EventsMail
// Second, we send to people linked to the event
// So, we get everyone
$sql = 'SELECT u.user_id, u.language, u.email, u.firstname, u.lastname
FROM ' . Database::get_main_table(TABLE_EVENT_TYPE_REL_USER) . ' ue
FROM ' . Database::get_main_table(TABLE_EVENT_TYPE_REL_USER).' ue
INNER JOIN '.Database::get_main_table(TABLE_MAIN_USER).' u ON u.user_id = ue.user_id
WHERE event_type_name = "' . $event_name . '"';
WHERE event_type_name = "' . $event_name.'"';
$result = Database::store_result(Database::query($sql), 'ASSOC');
// for each of the linked users
foreach ($result as $key => $value) {
@ -176,7 +176,7 @@ class EventsMail
// If the mail only need to be send once (we know that thanks to the events.conf, we log it in the table
if ($event_config[$event_name]["sending_mail_once"]) {
$sql = 'INSERT INTO ' . Database::get_main_table(TABLE_EVENT_SENT) . '
$sql = 'INSERT INTO '.Database::get_main_table(TABLE_EVENT_SENT).'
(user_from, user_to, event_type_name)
VALUES ('.$event_data["user_id"].', '.$value["user_id"].' , "'.Database::escape_string($event_name).'");
';
@ -201,16 +201,16 @@ class EventsMail
$current_language = api_get_interface_language();
$sql = 'SELECT COUNT(*) as total
FROM ' . Database::get_main_table(TABLE_EVENT_EMAIL_TEMPLATE) . ' em
INNER JOIN ' . Database::get_main_table(TABLE_MAIN_LANGUAGE) . ' l
FROM ' . Database::get_main_table(TABLE_EVENT_EMAIL_TEMPLATE).' em
INNER JOIN ' . Database::get_main_table(TABLE_MAIN_LANGUAGE).' l
ON em.language_id = l.id
WHERE
em.event_type_name = "' . $event_name . '" and
em.event_type_name = "' . $event_name.'" and
l.dokeos_folder = "'.$current_language.'" and
em.activated = 1';
$exists = Database::store_result(Database::query($sql), 'ASSOC');
if ($exists[0]["total"]) {
if ($exists[0]["total"]) {
return true;
} else {
return false;
@ -227,12 +227,12 @@ class EventsMail
private static function getMessage($event_name, $language)
{
$sql = 'SELECT message, subject, l.dokeos_folder
FROM ' . Database::get_main_table(TABLE_EVENT_EMAIL_TEMPLATE) . ' em
INNER JOIN ' . Database::get_main_table(TABLE_MAIN_LANGUAGE) . ' l
FROM ' . Database::get_main_table(TABLE_EVENT_EMAIL_TEMPLATE).' em
INNER JOIN ' . Database::get_main_table(TABLE_MAIN_LANGUAGE).' l
ON em.language_id = l.id
WHERE
em.event_type_name = "' . $event_name . '" AND
(l.dokeos_folder = "' . $language . '" OR l.dokeos_folder = "english") AND
em.event_type_name = "' . $event_name.'" AND
(l.dokeos_folder = "' . $language.'" OR l.dokeos_folder = "english") AND
em.message <> ""
';
return Database::store_result(Database::query($sql), 'ASSOC');
@ -273,8 +273,8 @@ class EventsMail
private static function formatMessage(&$message, &$subject, $event_config, $event_name, &$event_data)
{
foreach ($event_config[$event_name]["available_keyvars"] as $key => $word) {
$message = str_replace('((' . $key . '))', $event_data[$word], $message);
$subject = str_replace('((' . $key . '))', $event_data[$word], $subject);
$message = str_replace('(('.$key.'))', $event_data[$word], $message);
$subject = str_replace('(('.$key.'))', $event_data[$word], $subject);
}
}
}

@ -102,7 +102,7 @@ class Export
}
foreach ($data as $row) {
$string = implode("</td><td>", $row);
$string = '<tr><td>' . $string . '</td></tr>';
$string = '<tr><td>'.$string.'</td></tr>';
if ($encoding != 'utf-8') {
$string = api_convert_encoding($string, $encoding, $systemEncoding);
}
@ -176,7 +176,7 @@ class Export
fwrite($handle, '<'.$wrapper_tagname.'>');
}
$s = self::_export_complex_table_xml_helper($data);
fwrite($handle,$s);
fwrite($handle, $s);
if (!is_null($wrapper_tagname)) {
fwrite($handle, '</'.$wrapper_tagname.'>'."\n");
}
@ -198,10 +198,10 @@ class Export
}
$string = '';
foreach ($data as $row) {
$string .= "\n".str_repeat("\t",$level).'<'.$row['name'].'>';
$string .= "\n".str_repeat("\t", $level).'<'.$row['name'].'>';
if (is_array($row['value'])) {
$string .= self::_export_complex_table_xml_helper($row['value'],$level+1)."\n";
$string .= str_repeat("\t",$level).'</'.$row['name'].'>';
$string .= self::_export_complex_table_xml_helper($row['value'], $level + 1)."\n";
$string .= str_repeat("\t", $level).'</'.$row['name'].'>';
} else {
$string .= $row['value'];
$string .= '</'.$row['name'].'>';

@ -88,7 +88,7 @@ class DateRangePicker extends HTML_QuickForm_text
}
$timePicker = 'true';
$timePickerValue = $this->getAttribute('timePicker');
$timePickerValue = $this->getAttribute('timePicker');
if (!empty($timePickerValue)) {
$timePicker = $timePickerValue;
}

@ -27,11 +27,11 @@ class HTML_QuickForm_Rule_MultipleRequired extends HTML_QuickForm_Rule
*/
function validate($value, $options = null)
{
if(is_array($value))
if (is_array($value))
{
$value = implode(null,$value);
$value = implode(null, $value);
}
if ((string)$value == '') {
if ((string) $value == '') {
return false;
}
return true;

@ -145,10 +145,10 @@ class HookManagement implements HookManagementInterface
public function listHookObservers($eventName)
{
$array = array();
$joinTable = $this->tables[TABLE_HOOK_CALL] . ' hc' .
' INNER JOIN ' . $this->tables[TABLE_HOOK_EVENT] . ' he' .
' ON hc.hook_event_id = he.id ' .
' INNER JOIN ' . $this->tables[TABLE_HOOK_OBSERVER] . ' ho ' .
$joinTable = $this->tables[TABLE_HOOK_CALL].' hc'.
' INNER JOIN '.$this->tables[TABLE_HOOK_EVENT].' he'.
' ON hc.hook_event_id = he.id '.
' INNER JOIN '.$this->tables[TABLE_HOOK_OBSERVER].' ho '.
' ON hc.hook_observer_id = ho.id ';
$columns = 'ho.class_name, ho.path, ho.plugin_name, hc.enabled';
$where = array('where' => array('he.class_name = ? ' => $eventName, 'AND hc.enabled = ? ' => 1));
@ -202,10 +202,10 @@ class HookManagement implements HookManagementInterface
public function listAllHookCalls()
{
$array = array();
$joinTable = $this->tables[TABLE_HOOK_CALL] . ' hc' .
' INNER JOIN ' . $this->tables[TABLE_HOOK_EVENT] . ' he' .
' ON hc.hook_event_id = he.id ' .
' INNER JOIN ' . $this->tables[TABLE_HOOK_OBSERVER] . ' ho ' .
$joinTable = $this->tables[TABLE_HOOK_CALL].' hc'.
' INNER JOIN '.$this->tables[TABLE_HOOK_EVENT].' he'.
' ON hc.hook_event_id = he.id '.
' INNER JOIN '.$this->tables[TABLE_HOOK_OBSERVER].' ho '.
' ON hc.hook_observer_id = ho.id ';
$columns = 'he.class_name AS event_class_name, ho.class_name AS observer_class_name, hc.id AS id, hc.type AS type';
$rows = Database::select($columns, $joinTable);
@ -231,7 +231,7 @@ class HookManagement implements HookManagementInterface
if (isset($eventName) && !isset($this->hookEvents[$eventName])) {
$attributes = array(
'class_name' => $eventName,
'description' => get_lang('HookDescription' . $eventName),
'description' => get_lang('HookDescription'.$eventName),
);
$id = Database::insert($this->tables[TABLE_HOOK_EVENT], $attributes);
$this->hookEvents[$eventName] = $id;
@ -240,7 +240,7 @@ class HookManagement implements HookManagementInterface
// Check if exists hook observer
if (isset($observerClassName) &&
!isset($this->hookObservers[$observerClassName])
){
) {
$object = $observerClassName::create();
$attributes = array(
'class_name' => $observerClassName,
@ -338,10 +338,10 @@ class HookManagement implements HookManagementInterface
$eventName = Database::escape_string($eventName);
$observerClassName($observerClassName);
$type = Database::escape_string($type);
$joinTable = $this->tables[TABLE_HOOK_CALL] . ' hc' .
' INNER JOIN ' . $this->tables[TABLE_HOOK_EVENT] . ' he' .
' ON hc.hook_event_id = he.id ' .
' INNER JOIN ' . $this->tables[TABLE_HOOK_OBSERVER] . ' ho ' .
$joinTable = $this->tables[TABLE_HOOK_CALL].' hc'.
' INNER JOIN '.$this->tables[TABLE_HOOK_EVENT].' he'.
' ON hc.hook_event_id = he.id '.
' INNER JOIN '.$this->tables[TABLE_HOOK_OBSERVER].' ho '.
' ON hc.hook_observer_id = ho.id ';
$row = Database::select(
'id',

@ -18,30 +18,30 @@ class LoginRedirection
if (api_is_student() && !api_get_setting('student_page_after_login') == '') {
$redirect_url = html_entity_decode(api_get_setting('student_page_after_login'));
if ($redirect_url[0] == "/") {
$redirect_url = substr(api_get_path(WEB_PATH), 0, -1) . $redirect_url;
$redirect_url = substr(api_get_path(WEB_PATH), 0, -1).$redirect_url;
}
}
if (api_is_teacher() && !api_get_setting('teacher_page_after_login') == '') {
$redirect_url = html_entity_decode(api_get_setting('teacher_page_after_login'));
if ($redirect_url[0] == "/") {
$redirect_url = substr(api_get_path(WEB_PATH), 0, -1) . $redirect_url;
$redirect_url = substr(api_get_path(WEB_PATH), 0, -1).$redirect_url;
}
}
if (api_is_drh() && !api_get_setting('drh_page_after_login') == '') {
$redirect_url = html_entity_decode(api_get_setting('drh_page_after_login'));
if ($redirect_url[0] == "/") {
$redirect_url = substr(api_get_path(WEB_PATH), 0, -1) . $redirect_url;
$redirect_url = substr(api_get_path(WEB_PATH), 0, -1).$redirect_url;
}
}
if (api_is_session_admin() && !api_get_setting('sessionadmin_page_after_login') == '') {
$redirect_url = html_entity_decode(api_get_setting('sessionadmin_page_after_login'));
if ($redirect_url[0] == "/") {
$redirect_url = substr(api_get_path(WEB_PATH), 0, -1) . $redirect_url;
$redirect_url = substr(api_get_path(WEB_PATH), 0, -1).$redirect_url;
}
}
if (!empty($redirect_url)) {
header('Location: ' . $redirect_url . $param);
header('Location: '.$redirect_url.$param);
exit();
}
@ -49,7 +49,7 @@ class LoginRedirection
if (CustomPages::enabled()) {
CustomPages::display(CustomPages::INDEX_LOGGED);
}
header('location: ' . api_get_path(WEB_PATH) . api_get_setting('page_after_login') . $param);
header('location: '.api_get_path(WEB_PATH).api_get_setting('page_after_login').$param);
exit();
}
}

@ -482,14 +482,14 @@ class PortfolioShare
$attributes['z-index'] = 100000;
$s = ' ';
foreach ($attributes as $key => $value) {
$s .= $key . '="' . $value . '" ';
$s .= $key.'="'.$value.'" ';
}
$result = array();
$result[] = '<span ' . $s . ' >';
$result[] = '<span '.$s.' >';
$result[] = '<span class="dropdown" >';
$result[] = '<a href="#" data-toggle="dropdown" class="dropdown-toggle">';
$result[] = Display::return_icon('document_send.png', get_lang('Send'), array(), ICON_SIZE_SMALL) . '<b class="caret"></b>';
$result[] = Display::return_icon('document_send.png', get_lang('Send'), array(), ICON_SIZE_SMALL).'<b class="caret"></b>';
$result[] = '</a>';
$result[] = '<ul class="dropdown-menu">';
@ -505,7 +505,7 @@ class PortfolioShare
$parameters[PortfolioController::PARAM_TOOL] = $tool;
$url = api_get_path(WEB_CODE_PATH).'portfolio/share.php?';
$result[] = '<li>';
$result[] = '<a href="' . $url . '">' . $portfolio->get_title() . '</a>';
$result[] = '<a href="'.$url.'">'.$portfolio->get_title().'</a>';
$result[] = '</li>';
}
$result[] = '</ul>';
@ -564,8 +564,8 @@ class PortfolioBulkAction
*/
public function __construct($portfolio)
{
$this->name = md5(__CLASS__) . '_' . $portfolio->get_name();
$this->title = $portfolio->get_title() ? $portfolio->get_title() : get_lang('SendTo') . ' ' . $portfolio->get_name();
$this->name = md5(__CLASS__).'_'.$portfolio->get_name();
$this->title = $portfolio->get_title() ? $portfolio->get_title() : get_lang('SendTo').' '.$portfolio->get_name();
$this->portfolio = $portfolio;
}

@ -34,7 +34,7 @@ class Redirect
self::navigate($url);
}
$url = self::www() . $url;
$url = self::www().$url;
self::navigate($url);
}
@ -67,25 +67,25 @@ class Redirect
case COURSEMANAGER:
$redir = api_get_setting('teacher_page_after_login');
if (!empty($redir)) {
self::navigate(api_get_path(WEB_PATH) . $redir);
self::navigate(api_get_path(WEB_PATH).$redir);
}
break;
case STUDENT:
$redir = api_get_setting('student_page_after_login');
if (!empty($redir)) {
self::navigate(api_get_path(WEB_PATH) . $redir);
self::navigate(api_get_path(WEB_PATH).$redir);
}
break;
case DRH:
$redir = api_get_setting('drh_page_after_login');
if (!empty($redir)) {
self::navigate(api_get_path(WEB_PATH) . $redir);
self::navigate(api_get_path(WEB_PATH).$redir);
}
break;
case SESSIONADMIN:
$redir = api_get_setting('sessionadmin_page_after_login');
if (!empty($redir)) {
self::navigate(api_get_path(WEB_PATH) . $redir);
self::navigate(api_get_path(WEB_PATH).$redir);
}
break;
default:
@ -111,7 +111,7 @@ class Redirect
}
$page_after_login = api_get_setting('page_after_login');
if (!empty($page_after_login)) {
self::navigate(api_get_path(WEB_PATH) . $page_after_login);
self::navigate(api_get_path(WEB_PATH).$page_after_login);
}
}
}

@ -7,9 +7,9 @@
*/
class Rights {
private static $rights_cache = array();
private static $rights = array (
private static $rights = array(
'show_tabs:reports' =>
array (
array(
'type' => 'const',
'const' => 'true' )
);

@ -18,12 +18,12 @@ require 'xapian/XapianQuery.php';
* @param array extra Extra queries to join with. Optional
* @return array
*/
function chamilo_query_query($query_string, $offset=0, $length=10, $extra=NULL) {
function chamilo_query_query($query_string, $offset = 0, $length = 10, $extra = NULL) {
list($count, $results) = xapian_query($query_string, NULL, $offset, $length, $extra);
return chamilo_preprocess_results($results);
}
function chamilo_query_simple_query($query_string, $offset=0, $length=10, $extra=NULL) {
function chamilo_query_simple_query($query_string, $offset = 0, $length = 10, $extra = NULL) {
return xapian_query($query_string, NULL, $offset, $length, $extra);
}
@ -42,7 +42,7 @@ function chamilo_get_boolean_query($term) {
function chamilo_preprocess_results($results) {
// group by toolid
$results_by_tool = array();
if (count($results)>0) {
if (count($results) > 0) {
foreach ($results as $key => $row) {
$results_by_tool[$row['toolid']][] = $row;
@ -50,8 +50,8 @@ function chamilo_preprocess_results($results) {
$processed_results = array();
foreach ($results_by_tool as $toolid => $rows) {
$tool_processor_class = $toolid .'_processor';
$tool_processor_path = api_get_path(LIBRARY_PATH) .'search/tool_processors/'. $tool_processor_class .'.class.php';
$tool_processor_class = $toolid.'_processor';
$tool_processor_path = api_get_path(LIBRARY_PATH).'search/tool_processors/'.$tool_processor_class.'.class.php';
if (file_exists($tool_processor_path)) {
require_once($tool_processor_path);
$tool_processor = new $tool_processor_class($rows);
@ -71,6 +71,6 @@ function chamilo_preprocess_results($results) {
* @param string $op
* @return XapianQuery query joined
*/
function chamilo_join_queries($query1, $query2=NULL, $op='or') {
function chamilo_join_queries($query1, $query2 = NULL, $op = 'or') {
return xapian_join_queries($query1, $query2, $op);
}

@ -15,7 +15,7 @@ class Request
return isset($_REQUEST[$key]) ? $_REQUEST[$key] : $default;
}
public static function has($key){
public static function has($key) {
return isset($_REQUEST[$key]);
}

@ -157,7 +157,7 @@ class TableSort
$new_data_order = array();
if (!empty($docs_to_sort)) {
foreach($docs_to_sort as $id => $document) {
foreach ($docs_to_sort as $id => $document) {
if (isset($new_data[$id])) {
$new_data_order[] = $new_data[$id];
}
@ -165,7 +165,7 @@ class TableSort
}
if (!empty($folder_to_sort)) {
foreach($folder_to_sort as $id => $document) {
foreach ($folder_to_sort as $id => $document) {
if (isset($new_data[$id])) {
$new_data_order[] = $new_data[$id];
}

@ -20,49 +20,49 @@ if ($_POST['StoreRolePermissions'])
{
if (!empty($_POST['role_name']))
{
$table_role=Database::get_course_table(TABLE_ROLE);
$sql="INSERT INTO $table_role (role_name, role_comment, default_role)
$table_role = Database::get_course_table(TABLE_ROLE);
$sql = "INSERT INTO $table_role (role_name, role_comment, default_role)
VALUES ('".Database::escape_string($_POST['role_name'])."','".Database::escape_string($_POST['role_comment'])."','".Database::escape_string($_POST['default_role'])."')";
$result=Database::query($sql);
$role_id=Database::insert_id();
$result_message=store_permissions('role', $role_id);
$result = Database::query($sql);
$role_id = Database::insert_id();
$result_message = store_permissions('role', $role_id);
}
else
{
$result_message=get_lang('ErrorPleaseGiveRoleName');
$result_message = get_lang('ErrorPleaseGiveRoleName');
}
}
// storing a permission for a given role when the image approach is used
if (isset($_GET['action']) AND isset($_GET['permission']) AND isset($_GET['tool']))
{
if ($_GET['action']=='grant' OR $_GET['action']=='revoke')
if ($_GET['action'] == 'grant' OR $_GET['action'] == 'revoke')
{
$result_message=store_one_permission('role', $_GET['action'], $role_id, $_GET['tool'], $_GET['permission']);
$result_message = store_one_permission('role', $_GET['action'], $role_id, $_GET['tool'], $_GET['permission']);
}
}
// deleting a role
if (isset($_GET['action']) AND isset($_GET['role_id']) AND $_GET['action']=='delete') {
if (isset($_GET['action']) AND isset($_GET['role_id']) AND $_GET['action'] == 'delete') {
//deleting the assignments fo this role: users
$table=Database::get_course_table(TABLE_ROLE_USER);
$sql="DELETE FROM $table WHERE role_id='".intval($_GET['role_id'])."'";
$result=Database::query($sql);
$table = Database::get_course_table(TABLE_ROLE_USER);
$sql = "DELETE FROM $table WHERE role_id='".intval($_GET['role_id'])."'";
$result = Database::query($sql);
// deleting the assignments of this role: groups
$table=Database::get_course_table(TABLE_ROLE_GROUP);
$sql="DELETE FROM $table WHERE role_id='".intval($_GET['role_id'])."'";
$result=Database::query($sql);
$table = Database::get_course_table(TABLE_ROLE_GROUP);
$sql = "DELETE FROM $table WHERE role_id='".intval($_GET['role_id'])."'";
$result = Database::query($sql);
// deleting the permissions of this role
$table=Database::get_course_table(TABLE_ROLE_PERMISSION);
$sql="DELETE FROM $table WHERE role_id='".intval($_GET['role_id'])."'";
$result=Database::query($sql);
$table = Database::get_course_table(TABLE_ROLE_PERMISSION);
$sql = "DELETE FROM $table WHERE role_id='".intval($_GET['role_id'])."'";
$result = Database::query($sql);
// deleting the role
$table_role=Database::get_course_table(TABLE_ROLE);
$sql="DELETE FROM $table_role WHERE role_id='".intval($_GET['role_id'])."'";
$result=Database::query($sql);
$result_message=get_lang('RoleDeleted');
$table_role = Database::get_course_table(TABLE_ROLE);
$sql = "DELETE FROM $table_role WHERE role_id='".intval($_GET['role_id'])."'";
$result = Database::query($sql);
$result_message = get_lang('RoleDeleted');
}
// displaying the return message of the actions
@ -73,7 +73,7 @@ if (isset($result_message)) {
// ADDING A NEW ROLE (FORM AND LINK)
echo '<img src="../img/add.png" /> <a href="roles.php?action=add">'.get_lang('AddRole').'</a>';
if ($_GET['action']=='add')
if ($_GET['action'] == 'add')
{
echo "<form method=\"post\" action=\"".api_get_self()."\">";
echo "\n<table>";
@ -105,13 +105,13 @@ if ($_GET['action']=='add')
echo "<table class=\"data_table\">\n";
// the header
if (api_get_setting('permissions')=='limited')
if (api_get_setting('permissions') == 'limited')
{
$header_array=$rights_limited;
$header_array = $rights_limited;
}
if (api_get_setting('permissions')=='full')
if (api_get_setting('permissions') == 'full')
{
$header_array=$rights_full;
$header_array = $rights_full;
}
echo "\t<tr>\n";
echo "\t\t<th>".get_lang('Module')."</th>\n";
@ -151,25 +151,25 @@ if ($_GET['action']=='add')
// DISPLAYING THE EXISTING ROLES
// ===================================================
// platform roles
$all_roles=get_all_roles('platform');
$all_roles = get_all_roles('platform');
foreach ($all_roles as $role)
{
echo '<div><a href="roles.php?action=view&amp;role_id='.$role['role_id'].'&amp;scope=platform">'.$role['role_name'].'</a></div>';
echo '<div>'.$role['role_comment'].'</div><br />';
if ($role['role_id']==$_GET['role_id'])
if ($role['role_id'] == $_GET['role_id'])
{
$current_role_info=$role;
$current_role_info = $role;
}
}
// course roles
$all_roles=get_all_roles();
$all_roles = get_all_roles();
foreach ($all_roles as $role)
{
echo '<div><a href="roles.php?action=view&amp;role_id='.$role['role_id'].'">'.$role['role_name'].'</a><a href="roles.php?action=delete&amp;role_id='.$role['role_id'].'"><img src="../img/delete.gif" /></a></div>';
echo '<div>'.$role['role_comment'].'</div><br />';
if ($role['role_id']==$_GET['role_id'])
if ($role['role_id'] == $_GET['role_id'])
{
$current_role_info=$role;
$current_role_info = $role;
}
}
@ -178,19 +178,19 @@ foreach ($all_roles as $role)
// ===================================================
if ($_GET['role_id'])
{
$current_role_permissions=get_permissions('role',$_GET['role_id']);
$current_role_permissions = get_permissions('role', $_GET['role_id']);
// ---------------------------------------------------
// LIMITED OR FULL
// ---------------------------------------------------
$current_role_permissions=limited_or_full($current_role_permissions);
if (api_get_setting('permissions')=='limited')
$current_role_permissions = limited_or_full($current_role_permissions);
if (api_get_setting('permissions') == 'limited')
{
$header_array=$rights_limited;
$header_array = $rights_limited;
}
if (api_get_setting('permissions')=='full')
if (api_get_setting('permissions') == 'full')
{
$header_array=$rights_full;
$header_array = $rights_full;
}
// ---------------------------------------------------
// DISPLAYING THE MATRIX
@ -199,7 +199,7 @@ if ($_GET['role_id'])
// the list of the roles for the user
echo get_lang('PermissionsOfRole').':'.$current_role_info['role_name'].'<br />';
if ($_GET['scope']=='platform')
if ($_GET['scope'] == 'platform')
{
echo get_lang('IsPlatformRoleNotEditable').'<br />';
}
@ -226,23 +226,23 @@ if ($_GET['role_id'])
foreach ($header_array as $key=>$value)
{
echo "\t\t<td align='center'>\n";
if (in_array($value,$rights))
if (in_array($value, $rights))
{
if ($setting_visualisation=='checkbox')
if ($setting_visualisation == 'checkbox')
{
display_checkbox_matrix($current_role_permissions, $tool, $value);
}
if ($setting_visualisation=='image')
if ($setting_visualisation == 'image')
{
if ($_GET['scope']=='platform')
if ($_GET['scope'] == 'platform')
{
$roles_editable=false;
$roles_editable = false;
}
else
{
$roles_editable=true;
$roles_editable = true;
}
display_image_matrix($current_role_permissions, $tool, $value, '','',$roles_editable);
display_image_matrix($current_role_permissions, $tool, $value, '', '', $roles_editable);
}
}
echo "\t\t</td>\n";
@ -251,7 +251,7 @@ if ($_GET['role_id'])
}
echo "</table>\n";
if ($setting_visualisation=='checkbox')
if ($setting_visualisation == 'checkbox')
{
echo "<input type=\"Submit\" name=\"StoreRolePermissions\" value=\"".get_lang('StorePermissions')."\">";
}

@ -18,11 +18,11 @@ $this_section = SECTION_PLATFORM_ADMIN;
api_protect_admin_script(true);
$formSent=0;
$errorMsg='';
$formSent = 0;
$errorMsg = '';
//$interbreadcrumb[]=array('url' => 'index.php',"name" => get_lang('PlatformAdmin'));
$interbreadcrumb[] = array('url' => 'session_list.php','name' => get_lang('SessionList'));
$interbreadcrumb[] = array('url' => "session_category_list.php","name" => get_lang('ListSessionCategory'));
$interbreadcrumb[] = array('url' => 'session_list.php', 'name' => get_lang('SessionList'));
$interbreadcrumb[] = array('url' => "session_category_list.php", "name" => get_lang('ListSessionCategory'));
// Database Table Definitions
$tbl_user = Database::get_main_table(TABLE_MAIN_USER);
@ -61,7 +61,7 @@ $tool_name = get_lang('AddACategory');
//display the header
Display::display_header($tool_name);
if (!empty($return)) {
Display::display_error_message($return,false);
Display::display_error_message($return, false);
}
?>
<div class="row">
@ -72,13 +72,13 @@ if (!empty($return)) {
<div class="form-group">
<label class="col-sm-3 control-label"><?php echo get_lang('SessionCategoryName') ?></label>
<div class="col-sm-6">
<input type="text" class="form-control" name="name" placeholder="<?php echo get_lang('Category') ?>" size="50" maxlength="50" value="<?php if($formSent) echo api_htmlentities($name,ENT_QUOTES,$charset); ?>">
<input type="text" class="form-control" name="name" placeholder="<?php echo get_lang('Category') ?>" size="50" maxlength="50" value="<?php if ($formSent) echo api_htmlentities($name, ENT_QUOTES, $charset); ?>">
</div>
<div class="col-md-3"></div>
</div>
<div class="form-group">
<div class="col-sm-offset-3 col-sm-6">
<?php echo get_lang('TheTimeLimitsAreReferential');?> <a href="javascript://" onclick="if(document.getElementById('options').style.display == 'none'){document.getElementById('options').style.display = 'block';}else{document.getElementById('options').style.display = 'none';}"><?php echo get_lang('AddTimeLimit') ?></a>
<?php echo get_lang('TheTimeLimitsAreReferential'); ?> <a href="javascript://" onclick="if(document.getElementById('options').style.display == 'none'){document.getElementById('options').style.display = 'block';}else{document.getElementById('options').style.display = 'none';}"><?php echo get_lang('AddTimeLimit') ?></a>
</div>
<div class="col-md-3"></div>
</div>
@ -90,58 +90,58 @@ if (!empty($return)) {
<div class="col-sm-6">
<select name="day_start">
<option value="1">01</option>
<option value="2" <?php if((!$formSent && $thisDay == 2) || ($formSent && $day_start == 2)) echo 'selected="selected"'; ?> >02</option>
<option value="3" <?php if((!$formSent && $thisDay == 3) || ($formSent && $day_start == 3)) echo 'selected="selected"'; ?> >03</option>
<option value="4" <?php if((!$formSent && $thisDay == 4) || ($formSent && $day_start == 4)) echo 'selected="selected"'; ?> >04</option>
<option value="5" <?php if((!$formSent && $thisDay == 5) || ($formSent && $day_start == 5)) echo 'selected="selected"'; ?> >05</option>
<option value="6" <?php if((!$formSent && $thisDay == 6) || ($formSent && $day_start == 6)) echo 'selected="selected"'; ?> >06</option>
<option value="7" <?php if((!$formSent && $thisDay == 7) || ($formSent && $day_start == 7)) echo 'selected="selected"'; ?> >07</option>
<option value="8" <?php if((!$formSent && $thisDay == 8) || ($formSent && $day_start == 8)) echo 'selected="selected"'; ?> >08</option>
<option value="9" <?php if((!$formSent && $thisDay == 9) || ($formSent && $day_start == 9)) echo 'selected="selected"'; ?> >09</option>
<option value="10" <?php if((!$formSent && $thisDay == 10) || ($formSent && $day_start == 10)) echo 'selected="selected"'; ?> >10</option>
<option value="11" <?php if((!$formSent && $thisDay == 11) || ($formSent && $day_start == 11)) echo 'selected="selected"'; ?> >11</option>
<option value="12" <?php if((!$formSent && $thisDay == 12) || ($formSent && $day_start == 12)) echo 'selected="selected"'; ?> >12</option>
<option value="13" <?php if((!$formSent && $thisDay == 13) || ($formSent && $day_start == 13)) echo 'selected="selected"'; ?> >13</option>
<option value="14" <?php if((!$formSent && $thisDay == 14) || ($formSent && $day_start == 14)) echo 'selected="selected"'; ?> >14</option>
<option value="15" <?php if((!$formSent && $thisDay == 15) || ($formSent && $day_start == 15)) echo 'selected="selected"'; ?> >15</option>
<option value="16" <?php if((!$formSent && $thisDay == 16) || ($formSent && $day_start == 16)) echo 'selected="selected"'; ?> >16</option>
<option value="17" <?php if((!$formSent && $thisDay == 17) || ($formSent && $day_start == 17)) echo 'selected="selected"'; ?> >17</option>
<option value="18" <?php if((!$formSent && $thisDay == 18) || ($formSent && $day_start == 18)) echo 'selected="selected"'; ?> >18</option>
<option value="19" <?php if((!$formSent && $thisDay == 19) || ($formSent && $day_start == 19)) echo 'selected="selected"'; ?> >19</option>
<option value="20" <?php if((!$formSent && $thisDay == 20) || ($formSent && $day_start == 20)) echo 'selected="selected"'; ?> >20</option>
<option value="21" <?php if((!$formSent && $thisDay == 21) || ($formSent && $day_start == 21)) echo 'selected="selected"'; ?> >21</option>
<option value="22" <?php if((!$formSent && $thisDay == 22) || ($formSent && $day_start == 22)) echo 'selected="selected"'; ?> >22</option>
<option value="23" <?php if((!$formSent && $thisDay == 23) || ($formSent && $day_start == 23)) echo 'selected="selected"'; ?> >23</option>
<option value="24" <?php if((!$formSent && $thisDay == 24) || ($formSent && $day_start == 24)) echo 'selected="selected"'; ?> >24</option>
<option value="25" <?php if((!$formSent && $thisDay == 25) || ($formSent && $day_start == 25)) echo 'selected="selected"'; ?> >25</option>
<option value="26" <?php if((!$formSent && $thisDay == 26) || ($formSent && $day_start == 26)) echo 'selected="selected"'; ?> >26</option>
<option value="27" <?php if((!$formSent && $thisDay == 27) || ($formSent && $day_start == 27)) echo 'selected="selected"'; ?> >27</option>
<option value="28" <?php if((!$formSent && $thisDay == 28) || ($formSent && $day_start == 28)) echo 'selected="selected"'; ?> >28</option>
<option value="29" <?php if((!$formSent && $thisDay == 29) || ($formSent && $day_start == 29)) echo 'selected="selected"'; ?> >29</option>
<option value="30" <?php if((!$formSent && $thisDay == 30) || ($formSent && $day_start == 30)) echo 'selected="selected"'; ?> >30</option>
<option value="31" <?php if((!$formSent && $thisDay == 31) || ($formSent && $day_start == 31)) echo 'selected="selected"'; ?> >31</option>
<option value="2" <?php if ((!$formSent && $thisDay == 2) || ($formSent && $day_start == 2)) echo 'selected="selected"'; ?> >02</option>
<option value="3" <?php if ((!$formSent && $thisDay == 3) || ($formSent && $day_start == 3)) echo 'selected="selected"'; ?> >03</option>
<option value="4" <?php if ((!$formSent && $thisDay == 4) || ($formSent && $day_start == 4)) echo 'selected="selected"'; ?> >04</option>
<option value="5" <?php if ((!$formSent && $thisDay == 5) || ($formSent && $day_start == 5)) echo 'selected="selected"'; ?> >05</option>
<option value="6" <?php if ((!$formSent && $thisDay == 6) || ($formSent && $day_start == 6)) echo 'selected="selected"'; ?> >06</option>
<option value="7" <?php if ((!$formSent && $thisDay == 7) || ($formSent && $day_start == 7)) echo 'selected="selected"'; ?> >07</option>
<option value="8" <?php if ((!$formSent && $thisDay == 8) || ($formSent && $day_start == 8)) echo 'selected="selected"'; ?> >08</option>
<option value="9" <?php if ((!$formSent && $thisDay == 9) || ($formSent && $day_start == 9)) echo 'selected="selected"'; ?> >09</option>
<option value="10" <?php if ((!$formSent && $thisDay == 10) || ($formSent && $day_start == 10)) echo 'selected="selected"'; ?> >10</option>
<option value="11" <?php if ((!$formSent && $thisDay == 11) || ($formSent && $day_start == 11)) echo 'selected="selected"'; ?> >11</option>
<option value="12" <?php if ((!$formSent && $thisDay == 12) || ($formSent && $day_start == 12)) echo 'selected="selected"'; ?> >12</option>
<option value="13" <?php if ((!$formSent && $thisDay == 13) || ($formSent && $day_start == 13)) echo 'selected="selected"'; ?> >13</option>
<option value="14" <?php if ((!$formSent && $thisDay == 14) || ($formSent && $day_start == 14)) echo 'selected="selected"'; ?> >14</option>
<option value="15" <?php if ((!$formSent && $thisDay == 15) || ($formSent && $day_start == 15)) echo 'selected="selected"'; ?> >15</option>
<option value="16" <?php if ((!$formSent && $thisDay == 16) || ($formSent && $day_start == 16)) echo 'selected="selected"'; ?> >16</option>
<option value="17" <?php if ((!$formSent && $thisDay == 17) || ($formSent && $day_start == 17)) echo 'selected="selected"'; ?> >17</option>
<option value="18" <?php if ((!$formSent && $thisDay == 18) || ($formSent && $day_start == 18)) echo 'selected="selected"'; ?> >18</option>
<option value="19" <?php if ((!$formSent && $thisDay == 19) || ($formSent && $day_start == 19)) echo 'selected="selected"'; ?> >19</option>
<option value="20" <?php if ((!$formSent && $thisDay == 20) || ($formSent && $day_start == 20)) echo 'selected="selected"'; ?> >20</option>
<option value="21" <?php if ((!$formSent && $thisDay == 21) || ($formSent && $day_start == 21)) echo 'selected="selected"'; ?> >21</option>
<option value="22" <?php if ((!$formSent && $thisDay == 22) || ($formSent && $day_start == 22)) echo 'selected="selected"'; ?> >22</option>
<option value="23" <?php if ((!$formSent && $thisDay == 23) || ($formSent && $day_start == 23)) echo 'selected="selected"'; ?> >23</option>
<option value="24" <?php if ((!$formSent && $thisDay == 24) || ($formSent && $day_start == 24)) echo 'selected="selected"'; ?> >24</option>
<option value="25" <?php if ((!$formSent && $thisDay == 25) || ($formSent && $day_start == 25)) echo 'selected="selected"'; ?> >25</option>
<option value="26" <?php if ((!$formSent && $thisDay == 26) || ($formSent && $day_start == 26)) echo 'selected="selected"'; ?> >26</option>
<option value="27" <?php if ((!$formSent && $thisDay == 27) || ($formSent && $day_start == 27)) echo 'selected="selected"'; ?> >27</option>
<option value="28" <?php if ((!$formSent && $thisDay == 28) || ($formSent && $day_start == 28)) echo 'selected="selected"'; ?> >28</option>
<option value="29" <?php if ((!$formSent && $thisDay == 29) || ($formSent && $day_start == 29)) echo 'selected="selected"'; ?> >29</option>
<option value="30" <?php if ((!$formSent && $thisDay == 30) || ($formSent && $day_start == 30)) echo 'selected="selected"'; ?> >30</option>
<option value="31" <?php if ((!$formSent && $thisDay == 31) || ($formSent && $day_start == 31)) echo 'selected="selected"'; ?> >31</option>
</select>
/
<select name="month_start">
<option value="1">01</option>
<option value="2" <?php if((!$formSent && $thisMonth == 2) || ($formSent && $month_start == 2)) echo 'selected="selected"'; ?> >02</option>
<option value="3" <?php if((!$formSent && $thisMonth == 3) || ($formSent && $month_start == 3)) echo 'selected="selected"'; ?> >03</option>
<option value="4" <?php if((!$formSent && $thisMonth == 4) || ($formSent && $month_start == 4)) echo 'selected="selected"'; ?> >04</option>
<option value="5" <?php if((!$formSent && $thisMonth == 5) || ($formSent && $month_start == 5)) echo 'selected="selected"'; ?> >05</option>
<option value="6" <?php if((!$formSent && $thisMonth == 6) || ($formSent && $month_start == 6)) echo 'selected="selected"'; ?> >06</option>
<option value="7" <?php if((!$formSent && $thisMonth == 7) || ($formSent && $month_start == 7)) echo 'selected="selected"'; ?> >07</option>
<option value="8" <?php if((!$formSent && $thisMonth == 8) || ($formSent && $month_start == 8)) echo 'selected="selected"'; ?> >08</option>
<option value="9" <?php if((!$formSent && $thisMonth == 9) || ($formSent && $month_start == 9)) echo 'selected="selected"'; ?> >09</option>
<option value="10" <?php if((!$formSent && $thisMonth == 10) || ($formSent && $month_start == 10)) echo 'selected="selected"'; ?> >10</option>
<option value="11" <?php if((!$formSent && $thisMonth == 11) || ($formSent && $month_start == 11)) echo 'selected="selected"'; ?> >11</option>
<option value="12" <?php if((!$formSent && $thisMonth == 12) || ($formSent && $month_start == 12)) echo 'selected="selected"'; ?> >12</option>
<option value="2" <?php if ((!$formSent && $thisMonth == 2) || ($formSent && $month_start == 2)) echo 'selected="selected"'; ?> >02</option>
<option value="3" <?php if ((!$formSent && $thisMonth == 3) || ($formSent && $month_start == 3)) echo 'selected="selected"'; ?> >03</option>
<option value="4" <?php if ((!$formSent && $thisMonth == 4) || ($formSent && $month_start == 4)) echo 'selected="selected"'; ?> >04</option>
<option value="5" <?php if ((!$formSent && $thisMonth == 5) || ($formSent && $month_start == 5)) echo 'selected="selected"'; ?> >05</option>
<option value="6" <?php if ((!$formSent && $thisMonth == 6) || ($formSent && $month_start == 6)) echo 'selected="selected"'; ?> >06</option>
<option value="7" <?php if ((!$formSent && $thisMonth == 7) || ($formSent && $month_start == 7)) echo 'selected="selected"'; ?> >07</option>
<option value="8" <?php if ((!$formSent && $thisMonth == 8) || ($formSent && $month_start == 8)) echo 'selected="selected"'; ?> >08</option>
<option value="9" <?php if ((!$formSent && $thisMonth == 9) || ($formSent && $month_start == 9)) echo 'selected="selected"'; ?> >09</option>
<option value="10" <?php if ((!$formSent && $thisMonth == 10) || ($formSent && $month_start == 10)) echo 'selected="selected"'; ?> >10</option>
<option value="11" <?php if ((!$formSent && $thisMonth == 11) || ($formSent && $month_start == 11)) echo 'selected="selected"'; ?> >11</option>
<option value="12" <?php if ((!$formSent && $thisMonth == 12) || ($formSent && $month_start == 12)) echo 'selected="selected"'; ?> >12</option>
</select>
/
<select name="year_start">
<?php
for ($i=$thisYear-5;$i <= ($thisYear+5);$i++) {
for ($i = $thisYear - 5; $i <= ($thisYear + 5); $i++) {
?>
<option value="<?php echo $i; ?>" <?php if((!$formSent && $thisYear == $i) || ($formSent && $year_start == $i)) echo 'selected="selected"'; ?> ><?php echo $i; ?></option>
<option value="<?php echo $i; ?>" <?php if ((!$formSent && $thisYear == $i) || ($formSent && $year_start == $i)) echo 'selected="selected"'; ?> ><?php echo $i; ?></option>
<?php
}
?>
@ -206,7 +206,7 @@ if (!empty($return)) {
<select name="year_end">
<option value="0">----</option>
<?php
for ($i=$thisYear-5;$i <= ($thisYear+5);$i++) {
for ($i = $thisYear - 5; $i <= ($thisYear + 5); $i++) {
?>
<option value="<?php echo $i; ?>"><?php echo $i; ?></option>
<?php

@ -24,7 +24,7 @@ $tbl_session_course_user = Database::get_main_table(TABLE_MAIN_SESSION_COURSE
$tool_name = get_lang('ImportSessionListXMLCSV');
//$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin'));
$interbreadcrumb[] = array('url' => 'session_list.php','name' => get_lang('SessionList'));
$interbreadcrumb[] = array('url' => 'session_list.php', 'name' => get_lang('SessionList'));
set_time_limit(0);
@ -40,7 +40,7 @@ if (isset($_POST['formSent']) && $_POST['formSent']) {
$form_sent = $_POST['formSent'];
$file_type = isset($_POST['file_type']) ? $_POST['file_type'] : null;
$send_mail = isset($_POST['sendMail']) && $_POST['sendMail'] ? 1 : 0;
$isOverwrite = isset($_POST['overwrite']) && $_POST['overwrite'] ? true: false;
$isOverwrite = isset($_POST['overwrite']) && $_POST['overwrite'] ? true : false;
$deleteUsersNotInList = isset($_POST['delete_users_not_in_list']) ? true : false;
$sessions = array();
$session_counter = 0;
@ -318,7 +318,7 @@ if (isset($_POST['formSent']) && $_POST['formSent']) {
$sql = "INSERT IGNORE INTO $tbl_session_user SET
user_id ='$user_id',
session_id = '$session_id',
registered_at = '" . api_get_utc_datetime() . "'";
registered_at = '".api_get_utc_datetime()."'";
$rs_user = Database::query($sql);
$user_counter++;
}
@ -371,7 +371,7 @@ if (isset($_POST['formSent']) && $_POST['formSent']) {
$sql = "INSERT IGNORE INTO $tbl_session_user SET
user_id ='$user_id',
session_id = '$session_id',
registered_at = '" . api_get_utc_datetime() . "'";
registered_at = '".api_get_utc_datetime()."'";
$rs_user = Database::query($sql);
$user_counter++;
// Adding to session_rel_user_rel_course table.
@ -468,7 +468,7 @@ if (count($inserted_in_course) > 1) {
echo '<div class="actions">';
echo '<a href="../session/session_list.php">'.
Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('PlatformAdmin'),'',ICON_SIZE_MEDIUM).'</a>';
Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('PlatformAdmin'), '', ICON_SIZE_MEDIUM).'</a>';
echo '</div>';
if (!empty($error_message)) {
@ -485,7 +485,7 @@ $form->addElement(
get_lang('FileType'),
Display::url(
get_lang('ExampleCSVFile'),
api_get_path(WEB_CODE_PATH) . 'admin/example_session.csv',
api_get_path(WEB_CODE_PATH).'admin/example_session.csv',
['target' => '_blank']
)
],
@ -499,7 +499,7 @@ $form->addElement(
null,
Display::url(
get_lang('ExampleXMLFile'),
api_get_path(WEB_CODE_PATH) . 'admin/example_session.xml',
api_get_path(WEB_CODE_PATH).'admin/example_session.xml',
['target' => '_blank']
)
],
@ -514,7 +514,7 @@ $form->addElement('checkbox', 'add_me_as_coach', null, get_lang('AddMeAsCoach'))
$form->addElement('checkbox', 'sendMail', null, get_lang('SendMailToUsers'));
$form->addButtonImport(get_lang('ImportSession'));
$defaults = array('sendMail' => 'true','file_type' => 'csv');
$defaults = array('sendMail' => 'true', 'file_type' => 'csv');
$form->setDefaults($defaults);
Display::display_normal_message(get_lang('TheXMLImportLetYouAddMoreInfoAndCreateResources'));

@ -112,7 +112,7 @@ if ($invitationcode == 'auto' && isset($_GET['scode'])) {
$now = api_get_utc_datetime();
if (Database :: num_rows($result) == 0) {
$params = [
'c_id' => $course_id ,
'c_id' => $course_id,
'survey_code' => $surveyCode,
'user' => $userid,
'invitation_code' => $autoInvitationcode,
@ -482,7 +482,7 @@ if ($survey_data['form_fields'] != '' &&
$jquery_ready_content = $returnParams['jquery_ready_content'];
// the $jquery_ready_content variable collects all functions that will be load in the $(document).ready javascript function
$htmlHeadXtra[] ='<script>
$htmlHeadXtra[] = '<script>
$(document).ready(function(){
'.$jquery_ready_content.'
});
@ -915,16 +915,16 @@ if (isset($_GET['show']) || isset($_POST['personality'])) {
$group2 = $groups[0];
$secondary .= " OR ( survey_group_sec1 = '$group1' AND survey_group_sec2 = '$group2') ";
$secondary .= " OR ( survey_group_sec1 = '$group2' AND survey_group_sec2 = '$group1' ) ";
$combi.= $group1.' - '.$group2." or ".$group2.' - '.$group1.'<br />';
$combi .= $group1.' - '.$group2." or ".$group2.' - '.$group1.'<br />';
} else {
if ($i != 0) {
$secondary .= " OR ( survey_group_sec1 = '$group1' AND survey_group_sec2 = '$group2') ";
$secondary .= " OR ( survey_group_sec1 = '$group2' AND survey_group_sec2 = '$group1' ) ";
$combi.= $group1.' - '.$group2." or ".$group2.' - '.$group1.'<br />';
$combi .= $group1.' - '.$group2." or ".$group2.' - '.$group1.'<br />';
} else {
$secondary .= " ( survey_group_sec1 = '$group1' AND survey_group_sec2 = '$group2') ";
$secondary .= " OR ( survey_group_sec1 = '$group2' AND survey_group_sec2 = '$group1' ) ";
$combi.= $group1.' - '.$group2." or ".$group2.' - '.$group1.'<br />';
$combi .= $group1.' - '.$group2." or ".$group2.' - '.$group1.'<br />';
}
}
}
@ -1143,7 +1143,7 @@ if (isset($_GET['show']) || isset($_POST['personality'])) {
$questions[$row['sort']]['survey_group_sec1'] = $row['survey_group_sec1'];
$questions[$row['sort']]['survey_group_sec2'] = $row['survey_group_sec2'];
$questions[$row['sort']]['survey_group_pri'] = $row['survey_group_pri'];
} else {
} else {
// If the type is a page break we are finished loading the questions for this page
break;
}

@ -73,7 +73,7 @@ if ($action == 'copy_survey') {
if (api_is_allowed_to_edit()) {
SurveyManager::copy_survey($_GET['survey_id']);
$message = get_lang('SurveyCopied');
header('Location: ' . api_get_path(WEB_CODE_PATH) . 'survey/survey_list.php?' . api_get_cidreq());
header('Location: '.api_get_path(WEB_CODE_PATH).'survey/survey_list.php?'.api_get_cidreq());
exit;
}
}
@ -161,10 +161,10 @@ echo '<div class="actions">';
if (!api_is_course_coach() || $extend_rights_for_coachs == 'true') {
// Action links
echo '<a href="'.api_get_path(WEB_CODE_PATH).'survey/create_new_survey.php?'.api_get_cidreq().'&amp;action=add">'.
Display::return_icon('new_survey.png', get_lang('CreateNewSurvey'),'',ICON_SIZE_MEDIUM).'</a> ';
Display::return_icon('new_survey.png', get_lang('CreateNewSurvey'), '', ICON_SIZE_MEDIUM).'</a> ';
}
echo '<a href="'.api_get_self().'?'.api_get_cidreq().'&amp;search=advanced">'.
Display::return_icon('search.png', get_lang('Search'),'',ICON_SIZE_MEDIUM).'</a>';
Display::return_icon('search.png', get_lang('Search'), '', ICON_SIZE_MEDIUM).'</a>';
echo '</div>';
// Load main content

@ -78,7 +78,7 @@ function WSHelperVerifyKey($params)
}
if ($debug) {
error_log("checkip " . intval($check_ip));
error_log("checkip ".intval($check_ip));
}
if ($check_ip) {
@ -134,7 +134,7 @@ $server->wsdl->addComplexType(
'',
'SOAP-ENC:Array',
array(),
array(array('ref'=>'SOAP-ENC:arrayType','wsdl:arrayType' => 'tns:portalItem[]')),'tns:portalItem'
array(array('ref'=>'SOAP-ENC:arrayType', 'wsdl:arrayType' => 'tns:portalItem[]')), 'tns:portalItem'
);
$server->wsdl->addComplexType(
@ -149,13 +149,13 @@ $server->wsdl->addComplexType(
);
// Register the method to expose
$server->register('WSGetPortals', // method name
array('getPortals' => 'tns:getPortals'), // input parameters
array('return' => 'tns:portalList'), // output parameters
'urn:WSAccessUrl', // namespace
'urn:WSAccessUrl#WSGetPortals', // soapaction
'rpc', // style
'encoded', // use
$server->register('WSGetPortals', // method name
array('getPortals' => 'tns:getPortals'), // input parameters
array('return' => 'tns:portalList'), // output parameters
'urn:WSAccessUrl', // namespace
'urn:WSAccessUrl#WSGetPortals', // soapaction
'rpc', // style
'encoded', // use
'This service adds a user to portal' // documentation
);
@ -196,13 +196,13 @@ $server->wsdl->addComplexType(
);
// Register the method to expose
$server->register('WSAddUserToPortal', // method name
array('addUserToPortal' => 'tns:AddUserToPortal'), // input parameters
array('return' => 'xsd:string'), // output parameters
'urn:WSAccessUrl', // namespace
'urn:WSAccessUrl#WSAddUserToPortal', // soapaction
'rpc', // style
'encoded', // use
$server->register('WSAddUserToPortal', // method name
array('addUserToPortal' => 'tns:AddUserToPortal'), // input parameters
array('return' => 'xsd:string'), // output parameters
'urn:WSAccessUrl', // namespace
'urn:WSAccessUrl#WSAddUserToPortal', // soapaction
'rpc', // style
'encoded', // use
'This service adds a user to portal' // documentation
);
@ -227,13 +227,13 @@ function WSAddUserToPortal($params)
}
// Register the method to expose
$server->register('WSRemoveUserFromPortal', // method name
array('removeUserFromPortal' => 'tns:AddUserToPortal'), // input parameters
array('return' => 'xsd:string'), // output parameters
'urn:WSAccessUrl', // namespace
'urn:WSAccessUrl#WSRemoveUserFromPortal', // soapaction
'rpc', // style
'encoded', // use
$server->register('WSRemoveUserFromPortal', // method name
array('removeUserFromPortal' => 'tns:AddUserToPortal'), // input parameters
array('return' => 'xsd:string'), // output parameters
'urn:WSAccessUrl', // namespace
'urn:WSAccessUrl#WSRemoveUserFromPortal', // soapaction
'rpc', // style
'encoded', // use
'This service remove a user from a portal' // documentation
);
@ -270,13 +270,13 @@ $server->wsdl->addComplexType(
);
// Register the method to expose
$server->register('WSGetPortalListFromUser', // method name
array('getPortalListFromUser' => 'tns:getPortalListFromUser'), // input parameters
array('return' => 'tns:portalList'), // output parameters
'urn:WSAccessUrl', // namespace
'urn:WSAccessUrl#WSGetPortalListFromUser', // soapaction
'rpc', // style
'encoded', // use
$server->register('WSGetPortalListFromUser', // method name
array('getPortalListFromUser' => 'tns:getPortalListFromUser'), // input parameters
array('return' => 'tns:portalList'), // output parameters
'urn:WSAccessUrl', // namespace
'urn:WSAccessUrl#WSGetPortalListFromUser', // soapaction
'rpc', // style
'encoded', // use
'This service remove a user from a portal' // documentation
);
@ -314,13 +314,13 @@ $server->wsdl->addComplexType(
);
// Register the method to expose
$server->register('WSGetPortalListFromCourse', // method name
array('getPortalListFromCourse' => 'tns:getPortalListFromCourse'), // input parameters
array('return' => 'tns:portalList'), // output parameters
'urn:WSAccessUrl', // namespace
'urn:WSAccessUrl#getPortalListFromCourse', // soapaction
'rpc', // style
'encoded', // use
$server->register('WSGetPortalListFromCourse', // method name
array('getPortalListFromCourse' => 'tns:getPortalListFromCourse'), // input parameters
array('return' => 'tns:portalList'), // output parameters
'urn:WSAccessUrl', // namespace
'urn:WSAccessUrl#getPortalListFromCourse', // soapaction
'rpc', // style
'encoded', // use
'This service remove a user from a portal' // documentation
);
@ -364,13 +364,13 @@ $server->wsdl->addComplexType(
);
// Register the method to expose
$server->register('WSAddCourseToPortal', // method name
array('addCourseToPortal' => 'tns:addCourseToPortal'), // input parameters
array('return' => 'xsd:string'), // output parameters
'urn:WSAccessUrl', // namespace
'urn:WSAccessUrl#WSAddCourseToPortal', // soapaction
'rpc', // style
'encoded', // use
$server->register('WSAddCourseToPortal', // method name
array('addCourseToPortal' => 'tns:addCourseToPortal'), // input parameters
array('return' => 'xsd:string'), // output parameters
'urn:WSAccessUrl', // namespace
'urn:WSAccessUrl#WSAddCourseToPortal', // soapaction
'rpc', // style
'encoded', // use
'This service adds a course to portal' // documentation
);
@ -397,13 +397,13 @@ function WSAddCourseToPortal($params)
}
// Register the method to expose
$server->register('WSRemoveCourseFromPortal', // method name
array('removeCourseFromPortal' => 'tns:addCourseToPortal'), // input parameters
array('return' => 'xsd:string'), // output parameters
'urn:WSAccessUrl', // namespace
'urn:WSAccessUrl#WSRemoveCourseFromPortal', // soapaction
'rpc', // style
'encoded', // use
$server->register('WSRemoveCourseFromPortal', // method name
array('removeCourseFromPortal' => 'tns:addCourseToPortal'), // input parameters
array('return' => 'xsd:string'), // output parameters
'urn:WSAccessUrl', // namespace
'urn:WSAccessUrl#WSRemoveCourseFromPortal', // soapaction
'rpc', // style
'encoded', // use
'This service remove a course from a portal' // documentation
);

@ -33,7 +33,7 @@ $client->charencoding = 'UTF-8';*/
$soap_error = $client->getError();
if (!empty($soap_error)) {
$error_message = 'Nusoap object creation failed: ' . $soap_error;
$error_message = 'Nusoap object creation failed: '.$soap_error;
throw new Exception($error_message);
}
$client->setDebugLevel(10000);
@ -45,7 +45,7 @@ $ip_address = "192.168.1.54";
$ip_address = "127.0.0.1";
//Secret key
$secret_key = sha1($ip_address.$security_key);// Hash of the combination of IP Address + Chamilo security key
$secret_key = sha1($ip_address.$security_key); // Hash of the combination of IP Address + Chamilo security key
//$secret_key = sha1($security_key);
//Creating a random user_id, this values need to be provided from your system
@ -93,7 +93,7 @@ $err = $client->getError();
if ($err) {
// Display the error
echo '<h2>Constructor error</h2><pre>' . $err . '</pre>';
echo '<h2>Constructor error</h2><pre>'.$err.'</pre>';
}
@ -325,14 +325,14 @@ $err = $client->getError();
if ($err) {
// Display the error
echo '<h2>Constructor error</h2><pre>' . $err . '</pre>';
echo '<h2>Constructor error</h2><pre>'.$err.'</pre>';
}
//1. Create user webservice
$result = $client->call(
'WSGetPortals',
array('getPortals' => [ 'secret_key' => $secret_key])
array('getPortals' => ['secret_key' => $secret_key])
);
$result = $client->call(
@ -363,7 +363,7 @@ $result = $client->call(
);
var_dump($user_id);exit;
var_dump($user_id); exit;
@ -382,7 +382,7 @@ if ($client->fault) {
$err = $client->getError();
if ($err) {
// Display the error
echo '<h2>Error</h2><pre>' . $err . '</pre>';
echo '<h2>Error</h2><pre>'.$err.'</pre>';
} else {
// Display the result
echo '<h2>There are no errors</h2>';

@ -43,7 +43,7 @@ class WSCMSoapServer {
* Singleton method
*/
public static function singleton() {
if(!isset(self::$_instance)) {
if (!isset(self::$_instance)) {
self::$_instance = new soap_server();
// Set the error handler
WSCMError::setErrorHandler(new WSCMSoapErrorHandler());

@ -18,7 +18,7 @@ class WSCMAnnouncements extends WSCM
public function get_announcements_id($username, $password, $course_code)
{
if($this->verifyUserPass($username, $password) == "valid")
if ($this->verifyUserPass($username, $password) == "valid")
{
$result = self::get_announcements($username, $course_code);
@ -36,13 +36,13 @@ class WSCMAnnouncements extends WSCM
public function get_announcement_data($username, $password, $course_code, $announcement_id, $field)
{
if($this->verifyUserPass($username, $password) == "valid")
if ($this->verifyUserPass($username, $password) == "valid")
{
$htmlcode = false;
$user_id = UserManager::get_user_id_from_username($username);
$result = self::get_announcements($username, $course_code, $announcement_id);
while($announcement = Database::fetch_array($result))
while ($announcement = Database::fetch_array($result))
{
$announcements[] = $announcement;
}
@ -72,7 +72,7 @@ class WSCMAnnouncements extends WSCM
return (htmlcode) ? html_entity_decode($announcements[0][$field_table]) : $announcements[0][$field_table];
}else
} else
return get_lang('InvalidId');
}
@ -85,11 +85,11 @@ class WSCMAnnouncements extends WSCM
$announcement_id = ($announcement_id == 0) ? "" : "AND announcement.id=".$announcement_id;
$user_id = UserManager::get_user_id_from_username($username);
$course_info = CourseManager::get_course_information($course_code);
$tbl_item_property = Database::get_course_table(TABLE_ITEM_PROPERTY);
$tbl_announcement = Database::get_course_table(TABLE_ANNOUNCEMENT);
$maximum = '12';
$tbl_item_property = Database::get_course_table(TABLE_ITEM_PROPERTY);
$tbl_announcement = Database::get_course_table(TABLE_ANNOUNCEMENT);
$maximum = '12';
$group_memberships=GroupManager::get_group_ids($course_info['real_id'], $user_id);
$group_memberships = GroupManager::get_group_ids($course_info['real_id'], $user_id);
if (api_get_group_id() == 0) {
$cond_user_id = " AND (
@ -107,8 +107,8 @@ class WSCMAnnouncements extends WSCM
// the user is member of several groups => display personal
// announcements AND his group announcements AND the general announcements
if (is_array($group_memberships) && count($group_memberships)>0) {
$sql="SELECT
if (is_array($group_memberships) && count($group_memberships) > 0) {
$sql = "SELECT
announcement.*, ip.visibility, ip.to_group_id, ip.insert_user_id
FROM $tbl_announcement announcement, $tbl_item_property ip
WHERE

@ -18,12 +18,12 @@ class WSCMCourses extends WSCM
{
public function get_courses_code($username, $password) {
if($this->verifyUserPass($username, $password) == "valid") {
if ($this->verifyUserPass($username, $password) == "valid") {
$user_id = UserManager::get_user_id_from_username($username);
$listOfCourses = UserManager::get_personal_session_course_list($user_id);
$courses_id = "#";
foreach ($listOfCourses as $course){
foreach ($listOfCourses as $course) {
$courses_id .= $course['code']."#";
}
return $courses_id;
@ -34,7 +34,7 @@ class WSCMCourses extends WSCM
public function get_course_title($username, $password, $course_code)
{
if($this->verifyUserPass($username, $password) == "valid")
if ($this->verifyUserPass($username, $password) == "valid")
{
$course_info = CourseManager::get_course_information($course_code);
return $course_info['title'];

@ -15,7 +15,7 @@ class WSCMInbox extends WSCM
{
public function unreadMessage($username, $password)
{
if($this->verifyUserPass($username, $password) == "valid")
if ($this->verifyUserPass($username, $password) == "valid")
{
$table_message = Database::get_main_table(TABLE_MESSAGE);
$user_id = UserManager::get_user_id_from_username($username);
@ -33,14 +33,14 @@ class WSCMInbox extends WSCM
public function get_message_id($username, $password, $from, $number_of_items)
{
if($this->verifyUserPass($username, $password) == "valid")
if ($this->verifyUserPass($username, $password) == "valid")
{
$user_id = UserManager::get_user_id_from_username($username);
$table_message = Database::get_main_table(TABLE_MESSAGE);
$sql_query = "SELECT id FROM $table_message " .
" WHERE user_receiver_id=".$user_id." AND msg_status IN (0,1)" .
$sql_query = "SELECT id FROM $table_message ".
" WHERE user_receiver_id=".$user_id." AND msg_status IN (0,1)".
" ORDER BY send_date LIMIT $from,$number_of_items";
$sql_result = Database::query($sql_query);
@ -58,7 +58,7 @@ class WSCMInbox extends WSCM
public function get_message_data($username, $password, $message_id, $field)
{
if($this->verifyUserPass($username, $password) == "valid")
if ($this->verifyUserPass($username, $password) == "valid")
{
$htmlcode = false;
$user_id = UserManager::get_user_id_from_username($username);
@ -88,14 +88,14 @@ class WSCMInbox extends WSCM
$table_message = Database::get_main_table(TABLE_MESSAGE);
$sql_query = "SELECT ".$field_table." FROM $table_message " .
$sql_query = "SELECT ".$field_table." FROM $table_message ".
" WHERE user_receiver_id=".$user_id." AND id=".$message_id;
$sql_result = Database::query($sql_query);
$result = Database::fetch_row($sql_result);
return (htmlcode) ? html_entity_decode($result[0]) : $result[0];
}else
} else
return get_lang('InvalidId');
@ -103,14 +103,14 @@ class WSCMInbox extends WSCM
public function get_message_id_sent($username, $password, $from, $number_of_items)
{
if($this->verifyUserPass($username, $password) == "valid")
if ($this->verifyUserPass($username, $password) == "valid")
{
$user_id = UserManager::get_user_id_from_username($username);
$table_message = Database::get_main_table(TABLE_MESSAGE);
$sql_query = "SELECT id FROM $table_message " .
"WHERE user_sender_id=".$user_id." AND msg_status=".MESSAGE_STATUS_OUTBOX." " .
$sql_query = "SELECT id FROM $table_message ".
"WHERE user_sender_id=".$user_id." AND msg_status=".MESSAGE_STATUS_OUTBOX." ".
"ORDER BY send_date LIMIT $from,$number_of_items";
$sql_result = Database::query($sql_query);
@ -129,7 +129,7 @@ class WSCMInbox extends WSCM
public function get_message_data_sent($username, $password, $id, $field)
{
if($this->verifyUserPass($username, $password) == "valid")
if ($this->verifyUserPass($username, $password) == "valid")
{
$htmlcode = false;
switch ($field)
@ -159,7 +159,7 @@ class WSCMInbox extends WSCM
$table_message = Database::get_main_table(TABLE_MESSAGE);
$sql_query = "SELECT ".$field_table." FROM $table_message " .
$sql_query = "SELECT ".$field_table." FROM $table_message ".
" WHERE user_sender_id=".$user_id." AND id=".$id;
$sql_result = Database::query($sql_query);
@ -167,7 +167,7 @@ class WSCMInbox extends WSCM
return (htmlcode) ? html_entity_decode($result[0]) : $result[0];
}else
} else
return get_lang('InvalidId');
@ -176,7 +176,7 @@ class WSCMInbox extends WSCM
public function message_send($username, $password, $receiver_user_id, $subject, $content)
{
//TODO: verificar data de envio. Esta divergindo de data!
if($this->verifyUserPass($username, $password) == "valid")
if ($this->verifyUserPass($username, $password) == "valid")
{
$group_id = intval(0);
$parent_id = intval(0);
@ -207,7 +207,7 @@ class WSCMInbox extends WSCM
}
protected function set_message_as_read($user_id, $message_id){
protected function set_message_as_read($user_id, $message_id) {
$table_message = Database::get_main_table(TABLE_MESSAGE);
$query = "UPDATE $table_message SET msg_status = '".MESSAGE_STATUS_NEW."' WHERE user_receiver_id=".$user_id." AND id='".$message_id."';";
$result = Database::query($query);

@ -21,7 +21,7 @@ $tuser = Database::get_main_table(TABLE_MAIN_USER);
$tuserfv = Database::get_main_table(TABLE_EXTRA_FIELD_VALUES);
$sql = "SELECT user_id, username FROM $tuser ORDER BY user_id";
$res = Database::query($sql);
while($row = Database::fetch_array($res)) {
while ($row = Database::fetch_array($res)) {
$sql2 = "INSERT INTO $tuserfv (item_id, field_id, value)
VALUES (".$row['user_id'].", 11,'".$row['username']."')";
$res2 = Database::query($sql2);

@ -12,7 +12,7 @@ $nonce = uniqid();
$digest = getDigest();
// If there was no digest, show login
if (is_null($digest)) requireLogin($realm,$nonce);
if (is_null($digest)) requireLogin($realm, $nonce);
$digestParts = digestParse($digest);
@ -26,7 +26,7 @@ $A2 = md5("{$_SERVER['REQUEST_METHOD']}:{$digestParts['uri']}");
$validResponse = md5("{$A1}:{$digestParts['nonce']}:{$digestParts['nc']}:{$digestParts['cnonce']}:{$digestParts['qop']}:{$A2}");
if ($digestParts['response'] != $validResponse)
requireLogin($realm,$nonce);
requireLogin($realm, $nonce);
else {
// We're in!
echo 'a7532ae474e5e66a0c16eddab02e02a7';
@ -42,7 +42,7 @@ function getDigest() {
// most other servers
}
elseif (isset($_SERVER['HTTP_AUTHENTICATION'])) {
if (strpos(strtolower($_SERVER['HTTP_AUTHENTICATION']),'digest')===0)
if (strpos(strtolower($_SERVER['HTTP_AUTHENTICATION']), 'digest') === 0)
$digest = substr($_SERVER['HTTP_AUTHORIZATION'], 7);
}
elseif (isset($_SERVER['HTTP_WWW_AUTHENTICATE'])) {
@ -53,8 +53,8 @@ function getDigest() {
}
// This function forces a login prompt
function requireLogin($realm,$nonce) {
header('WWW-Authenticate: Digest realm="' . $realm . '",qop="auth",nonce="' . $nonce . '",opaque="' . md5($realm) . '"');
function requireLogin($realm, $nonce) {
header('WWW-Authenticate: Digest realm="'.$realm.'",qop="auth",nonce="'.$nonce.'",opaque="'.md5($realm).'"');
header('HTTP/1.1 401');
echo 'Authentication Canceled';
die();

@ -43,7 +43,7 @@ class WSSoapServer {
* Singleton method
*/
public static function singleton() {
if(!isset(self::$_instance)) {
if (!isset(self::$_instance)) {
self::$_instance = new soap_server();
// Set the error handler
WSError::setErrorHandler(new WSSoapErrorHandler());
@ -88,7 +88,7 @@ $s->wsdl->addComplexType(
'',
'SOAP-ENC:Array',
array(),
array(array('ref'=>'SOAP-ENC:arrayType','wsdl:arrayType' => 'tns:extras[]')),'tns:extras'
array(array('ref'=>'SOAP-ENC:arrayType', 'wsdl:arrayType' => 'tns:extras[]')), 'tns:extras'
);
/*

@ -5,7 +5,7 @@
*/
$ip = trim($_SERVER['REMOTE_ADDR']);
if (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
list($ip1,$ip2) = preg_split('/,/',$_SERVER['HTTP_X_FORWARDED_FOR']);
list($ip1, $ip2) = preg_split('/,/', $_SERVER['HTTP_X_FORWARDED_FOR']);
$ip = trim($ip1);
}
echo htmlentities($ip);

@ -59,5 +59,5 @@ $server = new soap_server();
$server->register('import_users_from_file');
$http_request = (isset($HTTP_RAW_POST_DATA)?$HTTP_RAW_POST_DATA:'');
$http_request = (isset($HTTP_RAW_POST_DATA) ? $HTTP_RAW_POST_DATA : '');
$server->service($http_request);

@ -26,11 +26,11 @@ $server->wsdl->addComplexType(
'all',
'',
array(
'name'=>'code' , 'type'=>'xsd:string',
'name'=>'title' , 'type'=>'xsd:string',
'name'=>'url' , 'type'=>'xsd:string',
'name'=>'code', 'type'=>'xsd:string',
'name'=>'title', 'type'=>'xsd:string',
'name'=>'url', 'type'=>'xsd:string',
'name'=>'teacher', 'type'=>'xsd:string',
'name'=>'language','type'=>'xsd:string',
'name'=>'language', 'type'=>'xsd:string',
)
);
@ -49,14 +49,14 @@ $server->wsdl->addComplexType(
);
// Register the method to expose
$server->register('WSCourseListOfUser', // method name
$server->register('WSCourseListOfUser', // method name
array('username' => 'xsd:string',
'signature' => 'xsd:string'), // input parameters
array('return' => 'xsd:Array'), // output parameters
'urn:WSUserInfo', // namespace
'urn:WSUserInfo#WSUserInfo', // soapaction
'rpc', // style
'encoded', // use
'signature' => 'xsd:string'), // input parameters
array('return' => 'xsd:Array'), // output parameters
'urn:WSUserInfo', // namespace
'urn:WSUserInfo#WSUserInfo', // soapaction
'rpc', // style
'encoded', // use
'This service returns a list of courses' // documentation
);
@ -104,11 +104,11 @@ $server->wsdl->addComplexType(
'all',
'',
array(
'name'=>'datestart','type'=>'xsd:string',
'name'=>'dateend','type'=>'xsd:string',
'name'=>'title','type'=>'xsd:string',
'name'=>'link','type'=>'xsd:string',
'name'=>'coursetitle','type'=>'xsd:string',
'name'=>'datestart', 'type'=>'xsd:string',
'name'=>'dateend', 'type'=>'xsd:string',
'name'=>'title', 'type'=>'xsd:string',
'name'=>'link', 'type'=>'xsd:string',
'name'=>'coursetitle', 'type'=>'xsd:string',
)
);
@ -127,16 +127,16 @@ $server->wsdl->addComplexType(
);
// Register the method to expose
$server->register('WSEventsList', // method name
$server->register('WSEventsList', // method name
array('username' => 'xsd:string',
'signature' => 'xsd:string',
'datestart' => 'xsd:int',
'dateend' => 'xsd:int'), // input parameters
array('return' => 'xsd:Array'), // output parameters
'urn:WSUserInfo', // namespace
'urn:WSUserInfo#WSEventsList', // soapaction
'rpc', // style
'encoded', // use
'dateend' => 'xsd:int'), // input parameters
array('return' => 'xsd:Array'), // output parameters
'urn:WSUserInfo', // namespace
'urn:WSUserInfo#WSEventsList', // soapaction
'rpc', // style
'encoded', // use
'This service returns a list of events of the courses the given user is subscribed to' // documentation
);
@ -171,8 +171,8 @@ function WSEventsList($username, $signature, $datestart = 0, $dateend = 0) {
$user_id = UserManager::get_user_id_from_username($username);
if ($user_id === false) { return $events_list; } // Error in user id recovery.
$ds = substr($datestart,0,4).'-'.substr($datestart,4,2).'-'.substr($datestart,6,2).' 00:00:00';
$de = substr($dateend,0,4).'-'.substr($dateend,4,2).'-'.substr($dateend,6,2).' 00:00:00';
$ds = substr($datestart, 0, 4).'-'.substr($datestart, 4, 2).'-'.substr($datestart, 6, 2).' 00:00:00';
$de = substr($dateend, 0, 4).'-'.substr($dateend, 4, 2).'-'.substr($dateend, 6, 2).' 00:00:00';
$events_list = Agenda::get_personal_agenda_items_between_dates($user_id, $ds, $de);
return $events_list;
}

@ -49,7 +49,7 @@ class WSError
* @param WSErrorHandler Error handler
*/
public static function setErrorHandler($handler) {
if($handler instanceof WSErrorHandler) {
if ($handler instanceof WSErrorHandler) {
self::$_handler = $handler;
}
}
@ -114,12 +114,12 @@ class WS {
// if we are behind a reverse proxy, assume it will send the
// HTTP_X_FORWARDED_FOR header and use this IP instead
if (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
list($ip1,$ip2) = preg_split('/,/',$_SERVER['HTTP_X_FORWARDED_FOR']);
list($ip1, $ip2) = preg_split('/,/', $_SERVER['HTTP_X_FORWARDED_FOR']);
$ip = trim($ip1);
}
$security_key = $ip.$this->_configuration['security_key'];
if(!api_is_valid_secret_key($secret_key, $security_key)) {
if (!api_is_valid_secret_key($secret_key, $security_key)) {
return new WSError(1, "API key is invalid");
} else {
return null;
@ -136,15 +136,15 @@ class WS {
* @return mixed System user id if the user was found, WSError otherwise
*/
protected function getUserId($user_id_field_name, $user_id_value) {
if($user_id_field_name == "chamilo_user_id") {
if(UserManager::is_user_id_valid(intval($user_id_value))) {
if ($user_id_field_name == "chamilo_user_id") {
if (UserManager::is_user_id_valid(intval($user_id_value))) {
return intval($user_id_value);
} else {
return new WSError(100, "User not found");
}
} else {
$user_id = UserManager::get_user_id_from_original_id($user_id_value, $user_id_field_name);
if($user_id == 0) {
if ($user_id == 0) {
return new WSError(100, "User not found");
} else {
return $user_id;
@ -197,7 +197,7 @@ class WS {
protected function getSessionId($session_id_field_name, $session_id_value)
{
if ($session_id_field_name == "chamilo_session_id") {
$session = SessionManager::fetch((int)$session_id_value);
$session = SessionManager::fetch((int) $session_id_value);
if (!empty($session)) {
return intval($session_id_value);
} else {

@ -20,7 +20,7 @@ class WSReport extends WS {
*/
public function GetTimeSpentOnPlatform($user_id_field_name, $user_id_value) {
$user_id = $this->getUserId($user_id_field_name, $user_id_value);
if($user_id instanceof WSError) {
if ($user_id instanceof WSError) {
return $user_id;
} else {
return Tracking::get_time_spent_on_the_platform($user_id);
@ -38,11 +38,11 @@ class WSReport extends WS {
*/
public function GetTimeSpentOnCourse($user_id_field_name, $user_id_value, $course_id_field_name, $course_id_value) {
$user_id = $this->getUserId($user_id_field_name, $user_id_value);
if($user_id instanceof WSError) {
if ($user_id instanceof WSError) {
return $user_id;
}
$course_id = $this->getCourseId($course_id_field_name, $course_id_value);
if($course_id instanceof WSError) {
if ($course_id instanceof WSError) {
return $course_id;
} else {
$course_code = CourseManager::get_course_code_from_course_id($course_id);
@ -61,17 +61,17 @@ class WSReport extends WS {
*/
public function GetTimeSpentOnCourseInSession($user_id_field_name, $user_id_value, $course_id_field_name, $course_id_value, $session_id_field_name, $session_id_value) {
$user_id = $this->getUserId($user_id_field_name, $user_id_value);
if($user_id instanceof WSError) {
if ($user_id instanceof WSError) {
return $user_id;
}
$course_id = $this->getCourseId($course_id_field_name, $course_id_value);
if($course_id instanceof WSError) {
if ($course_id instanceof WSError) {
return $course_id;
} else {
$course_code = CourseManager::get_course_code_from_course_id($course_id);
}
$session_id = $this->getSessionId($session_id_field_name, $session_id_value);
if($session_id instanceof WSError) {
if ($session_id instanceof WSError) {
return $session_id;
}
return Tracking::get_time_spent_on_the_course($user_id, $course_id, $session_id);
@ -87,17 +87,17 @@ class WSReport extends WS {
*/
public function GetLearnpathsByCourse($secret_key, $user_id_field_name, $user_id_value, $course_id_field_name, $course_id_value) {
$user_id = $this->getUserId($user_id_field_name, $user_id_value);
if($user_id instanceof WSError) {
if ($user_id instanceof WSError) {
return $user_id;
}
$course_id = $this->getCourseId($course_id_field_name, $course_id_value);
if($course_id instanceof WSError) {
if ($course_id instanceof WSError) {
return $course_id;
} else {
$course_code = CourseManager::get_course_code_from_course_id($course_id);
}
$lp = new LearnpathList($user_id,$course_code);
$lp = new LearnpathList($user_id, $course_code);
$list = $lp->list;
$return = array();
foreach ($list as $id => $item) {
@ -117,11 +117,11 @@ class WSReport extends WS {
*/
public function GetLearnpathProgress($secret_key, $user_id_field_name, $user_id_value, $course_id_field_name, $course_id_value, $learnpath_id) {
$user_id = $this->getUserId($user_id_field_name, $user_id_value);
if($user_id instanceof WSError) {
if ($user_id instanceof WSError) {
return $user_id;
}
$course_id = $this->getCourseId($course_id_field_name, $course_id_value);
if($course_id instanceof WSError) {
if ($course_id instanceof WSError) {
return $course_id;
} else {
$course_code = CourseManager::get_course_code_from_course_id($course_id);
@ -150,11 +150,11 @@ class WSReport extends WS {
*/
public function GetLearnpathHighestLessonLocation($secret_key, $user_id_field_name, $user_id_value, $course_id_field_name, $course_id_value, $learnpath_id) {
$user_id = $this->getUserId($user_id_field_name, $user_id_value);
if($user_id instanceof WSError) {
if ($user_id instanceof WSError) {
return $user_id;
}
$course_id = $this->getCourseId($course_id_field_name, $course_id_value);
if($course_id instanceof WSError) {
if ($course_id instanceof WSError) {
return $course_id;
} else {
$course_code = CourseManager::get_course_code_from_course_id($course_id);
@ -179,11 +179,11 @@ class WSReport extends WS {
*/
public function GetLearnpathScoreSingleItem($secret_key, $user_id_field_name, $user_id_value, $course_id_field_name, $course_id_value, $learnpath_id, $learnpath_item_id) {
$user_id = $this->getUserId($user_id_field_name, $user_id_value);
if($user_id instanceof WSError) {
if ($user_id instanceof WSError) {
return $user_id;
}
$course_id = $this->getCourseId($course_id_field_name, $course_id_value);
if($course_id instanceof WSError) {
if ($course_id instanceof WSError) {
return $course_id;
} else {
$course_code = CourseManager::get_course_code_from_course_id($course_id);
@ -213,15 +213,15 @@ class WSReport extends WS {
*/
public function GetLearnpathStatusSingleItem($secret_key, $user_id_field_name, $user_id_value, $course_id_field_name, $course_id_value, $learnpath_id, $learnpath_item_id) {
$verifKey = $this->verifyKey($secret_key);
if($verifKey instanceof WSError) {
if ($verifKey instanceof WSError) {
$this->handleError($verifKey);
} else {
$user_id = $this->getUserId($user_id_field_name, $user_id_value);
if($user_id instanceof WSError) {
if ($user_id instanceof WSError) {
return $user_id;
}
$course_id = $this->getCourseId($course_id_field_name, $course_id_value);
if($course_id instanceof WSError) {
if ($course_id instanceof WSError) {
return $course_id;
} else {
$course_code = CourseManager::get_course_code_from_course_id($course_id);

@ -41,7 +41,7 @@ if (!empty($workData)) {
) {
if (Security::check_abs_path(
$workData['file_path'],
api_get_path(SYS_COURSE_PATH) . api_get_course_path() . '/'
api_get_path(SYS_COURSE_PATH).api_get_course_path().'/'
)
) {
DocumentManager::file_send_for_download(

@ -67,12 +67,12 @@ if (session_id() == "") {
function CallShortcutExpressCheckout($paymentAmount, $currencyCodeType, $paymentType, $returnURL, $cancelURL, $extra)
{
// Construct the parameter string that describes the SetExpressCheckout API call in the shortcut implementation
$nvpstr = "&PAYMENTREQUEST_0_AMT=" . $paymentAmount;
$nvpstr .= "&PAYMENTREQUEST_0_ITEMAMT=" . $paymentAmount;
$nvpstr .= "&PAYMENTREQUEST_0_PAYMENTACTION=" . $paymentType;
$nvpstr .= "&RETURNURL=" . $returnURL;
$nvpstr .= "&CANCELURL=" . $cancelURL;
$nvpstr .= "&PAYMENTREQUEST_0_CURRENCYCODE=" . $currencyCodeType;
$nvpstr = "&PAYMENTREQUEST_0_AMT=".$paymentAmount;
$nvpstr .= "&PAYMENTREQUEST_0_ITEMAMT=".$paymentAmount;
$nvpstr .= "&PAYMENTREQUEST_0_PAYMENTACTION=".$paymentType;
$nvpstr .= "&RETURNURL=".$returnURL;
$nvpstr .= "&CANCELURL=".$cancelURL;
$nvpstr .= "&PAYMENTREQUEST_0_CURRENCYCODE=".$currencyCodeType;
$nvpstr .= $extra;
$_SESSION["currencyCodeType"] = $currencyCodeType;
@ -116,20 +116,20 @@ function CallMarkExpressCheckout($paymentAmount, $currencyCodeType, $paymentType
)
{
// Construct the parameter string that describes the SetExpressCheckout API call in the shortcut implementation
$nvpstr = "&PAYMENTREQUEST_0_AMT=" . $paymentAmount;
$nvpstr = $nvpstr . "&PAYMENTREQUEST_0_PAYMENTACTION=" . $paymentType;
$nvpstr = $nvpstr . "&RETURNURL=" . $returnURL;
$nvpstr = $nvpstr . "&CANCELURL=" . $cancelURL;
$nvpstr = $nvpstr . "&PAYMENTREQUEST_0_CURRENCYCODE=" . $currencyCodeType;
$nvpstr = $nvpstr . "&ADDROVERRIDE=1";
$nvpstr = $nvpstr . "&PAYMENTREQUEST_0_SHIPTONAME=" . $shipToName;
$nvpstr = $nvpstr . "&PAYMENTREQUEST_0_SHIPTOSTREET=" . $shipToStreet;
$nvpstr = $nvpstr . "&PAYMENTREQUEST_0_SHIPTOSTREET2=" . $shipToStreet2;
$nvpstr = $nvpstr . "&PAYMENTREQUEST_0_SHIPTOCITY=" . $shipToCity;
$nvpstr = $nvpstr . "&PAYMENTREQUEST_0_SHIPTOSTATE=" . $shipToState;
$nvpstr = $nvpstr . "&PAYMENTREQUEST_0_SHIPTOCOUNTRYCODE=" . $shipToCountryCode;
$nvpstr = $nvpstr . "&PAYMENTREQUEST_0_SHIPTOZIP=" . $shipToZip;
$nvpstr = $nvpstr . "&PAYMENTREQUEST_0_SHIPTOPHONENUM=" . $phoneNum;
$nvpstr = "&PAYMENTREQUEST_0_AMT=".$paymentAmount;
$nvpstr = $nvpstr."&PAYMENTREQUEST_0_PAYMENTACTION=".$paymentType;
$nvpstr = $nvpstr."&RETURNURL=".$returnURL;
$nvpstr = $nvpstr."&CANCELURL=".$cancelURL;
$nvpstr = $nvpstr."&PAYMENTREQUEST_0_CURRENCYCODE=".$currencyCodeType;
$nvpstr = $nvpstr."&ADDROVERRIDE=1";
$nvpstr = $nvpstr."&PAYMENTREQUEST_0_SHIPTONAME=".$shipToName;
$nvpstr = $nvpstr."&PAYMENTREQUEST_0_SHIPTOSTREET=".$shipToStreet;
$nvpstr = $nvpstr."&PAYMENTREQUEST_0_SHIPTOSTREET2=".$shipToStreet2;
$nvpstr = $nvpstr."&PAYMENTREQUEST_0_SHIPTOCITY=".$shipToCity;
$nvpstr = $nvpstr."&PAYMENTREQUEST_0_SHIPTOSTATE=".$shipToState;
$nvpstr = $nvpstr."&PAYMENTREQUEST_0_SHIPTOCOUNTRYCODE=".$shipToCountryCode;
$nvpstr = $nvpstr."&PAYMENTREQUEST_0_SHIPTOZIP=".$shipToZip;
$nvpstr = $nvpstr."&PAYMENTREQUEST_0_SHIPTOPHONENUM=".$phoneNum;
$_SESSION["currencyCodeType"] = $currencyCodeType;
$_SESSION["PaymentType"] = $paymentType;
@ -172,7 +172,7 @@ function GetShippingDetails($token)
* Build a second API request to PayPal, using the token as the
* ID to get the details on the payment authorization
*/
$nvpstr = "&TOKEN=" . $token;
$nvpstr = "&TOKEN=".$token;
/**
* Make the API call and store the results in an array.
@ -213,9 +213,9 @@ function ConfirmPayment($FinalPaymentAmt)
$payerID = urlencode($_SESSION['payer_id']);
$serverName = urlencode($_SERVER['SERVER_NAME']);
$nvpstr = '&TOKEN=' . $token . '&PAYERID=' . $payerID . '&PAYMENTREQUEST_0_PAYMENTACTION=' . $paymentType . '&PAYMENTREQUEST_0_AMT=' . $FinalPaymentAmt;
$nvpstr .= '&PAYMENTREQUEST_0_CURRENCYCODE=' . $currencyCodeType . '&IPADDRESS=' . $serverName;
$nvpstr = '&' . http_build_query([
$nvpstr = '&TOKEN='.$token.'&PAYERID='.$payerID.'&PAYMENTREQUEST_0_PAYMENTACTION='.$paymentType.'&PAYMENTREQUEST_0_AMT='.$FinalPaymentAmt;
$nvpstr .= '&PAYMENTREQUEST_0_CURRENCYCODE='.$currencyCodeType.'&IPADDRESS='.$serverName;
$nvpstr = '&'.http_build_query([
'TOKEN' => $token,
'PAYERID' => $payerID,
'PAYMENTACTION' => $paymentType,
@ -269,20 +269,20 @@ function DirectPayment($paymentType, $paymentAmount, $creditCardType, $creditCar
$countryCode, $currencyCode)
{
//Construct the parameter string that describes DoDirectPayment
$nvpstr = "&AMT=" . $paymentAmount;
$nvpstr = $nvpstr . "&CURRENCYCODE=" . $currencyCode;
$nvpstr = $nvpstr . "&PAYMENTACTION=" . $paymentType;
$nvpstr = $nvpstr . "&CREDITCARDTYPE=" . $creditCardType;
$nvpstr = $nvpstr . "&ACCT=" . $creditCardNumber;
$nvpstr = $nvpstr . "&EXPDATE=" . $expDate;
$nvpstr = $nvpstr . "&CVV2=" . $cvv2;
$nvpstr = $nvpstr . "&FIRSTNAME=" . $firstName;
$nvpstr = $nvpstr . "&LASTNAME=" . $lastName;
$nvpstr = $nvpstr . "&STREET=" . $street;
$nvpstr = $nvpstr . "&CITY=" . $city;
$nvpstr = $nvpstr . "&STATE=" . $state;
$nvpstr = $nvpstr . "&COUNTRYCODE=" . $countryCode;
$nvpstr = $nvpstr . "&IPADDRESS=" . $_SERVER['REMOTE_ADDR'];
$nvpstr = "&AMT=".$paymentAmount;
$nvpstr = $nvpstr."&CURRENCYCODE=".$currencyCode;
$nvpstr = $nvpstr."&PAYMENTACTION=".$paymentType;
$nvpstr = $nvpstr."&CREDITCARDTYPE=".$creditCardType;
$nvpstr = $nvpstr."&ACCT=".$creditCardNumber;
$nvpstr = $nvpstr."&EXPDATE=".$expDate;
$nvpstr = $nvpstr."&CVV2=".$cvv2;
$nvpstr = $nvpstr."&FIRSTNAME=".$firstName;
$nvpstr = $nvpstr."&LASTNAME=".$lastName;
$nvpstr = $nvpstr."&STREET=".$street;
$nvpstr = $nvpstr."&CITY=".$city;
$nvpstr = $nvpstr."&STATE=".$state;
$nvpstr = $nvpstr."&COUNTRYCODE=".$countryCode;
$nvpstr = $nvpstr."&IPADDRESS=".$_SERVER['REMOTE_ADDR'];
$resArray = hash_call("DoDirectPayment", $nvpstr);
@ -345,13 +345,13 @@ function hash_call($methodName, $nvpStr)
//if USE_PROXY constant set to TRUE in Constants.php, then only proxy will be enabled.
//Set proxy name to PROXY_HOST and port number to PROXY_PORT in constants.php
if ($USE_PROXY) {
curl_setopt($ch, CURLOPT_PROXY, $PROXY_HOST . ":" . $PROXY_PORT);
curl_setopt($ch, CURLOPT_PROXY, $PROXY_HOST.":".$PROXY_PORT);
}
//NVPRequest for submitting to server
$nvpreq = "METHOD=" . urlencode($methodName) . "&VERSION=" . urlencode($version) .
"&PWD=" . urlencode($API_Password) . "&USER=" . urlencode($API_UserName) .
"&SIGNATURE=" . urlencode($API_Signature) . $nvpStr . "&BUTTONSOURCE=" . urlencode($sBNCode);
$nvpreq = "METHOD=".urlencode($methodName)."&VERSION=".urlencode($version).
"&PWD=".urlencode($API_Password)."&USER=".urlencode($API_UserName).
"&SIGNATURE=".urlencode($API_Signature).$nvpStr."&BUTTONSOURCE=".urlencode($sBNCode);
//setting the nvpreq as POST FIELD to curl
curl_setopt($ch, CURLOPT_POSTFIELDS, $nvpreq);
@ -385,8 +385,8 @@ function RedirectToPayPal($token)
{
global $PAYPAL_URL;
// Redirect to paypal.com here
$payPalURL = $PAYPAL_URL . $token;
header("Location: " . $payPalURL);
$payPalURL = $PAYPAL_URL.$token;
header("Location: ".$payPalURL);
exit;
}

@ -63,19 +63,19 @@ class BlockCourse extends Block
$content = $this->get_content_html();
$html = '
<div class="panel panel-default" id="intro">
<div class="panel-heading">' . get_lang('CoursesInformation') . '
<div class="panel-heading">' . get_lang('CoursesInformation').'
<div class="pull-right"><a class="btn btn-danger btn-xs" onclick="javascript:if(!confirm(\'' . addslashes(
api_htmlentities(
get_lang('ConfirmYourChoice'),
ENT_QUOTES,
$charset
)
) . '\')) return false;" href="index.php?action=disable_block&path=' . $this->path . '">
).'\')) return false;" href="index.php?action=disable_block&path='.$this->path.'">
<em class="fa fa-times"></em>
</a></div>
</div>
<div class="panel-body">
' . $content . '
' . $content.'
</div>
</div>
';
@ -93,17 +93,17 @@ class BlockCourse extends Block
{
$course_data = $this->get_course_information_data();
//$content = '<div style="margin:10px;">';
$content = '<h4>' . get_lang(
$content = '<h4>'.get_lang(
'YourCourseList'
) . '</h4>';
).'</h4>';
$data_table = null;
if (!empty($course_data)) {
$data_table .= '<table class="data_table" width:"95%">';
$data_table .= '<tr>
<th>' . get_lang('CourseTitle') . '</th>
<th width="20%">' . get_lang('NbStudents') . '</th>
<th width="20%">' . get_lang('AvgTimeSpentInTheCourse') . '</th>
<th width="20%">' . get_lang('ThematicAdvance') . '</th>
<th>' . get_lang('CourseTitle').'</th>
<th width="20%">' . get_lang('NbStudents').'</th>
<th width="20%">' . get_lang('AvgTimeSpentInTheCourse').'</th>
<th width="20%">' . get_lang('ThematicAdvance').'</th>
</tr>';
$i = 1;
foreach ($course_data as $course) {
@ -112,12 +112,12 @@ class BlockCourse extends Block
} else {
$class_tr = 'row_even';
}
$data_table .= '<tr class="' . $class_tr . '">';
$data_table .= '<tr class="'.$class_tr.'">';
if (!isset($course[2])) {
$course[2] = '0:00:00';
}
foreach ($course as $cell) {
$data_table .= '<td align="right">' . $cell . '</td>';
$data_table .= '<td align="right">'.$cell.'</td>';
}
$data_table .= '</tr>';
$i++;
@ -128,7 +128,7 @@ class BlockCourse extends Block
}
$content .= $data_table;
if (!empty($course_data)) {
$content .= '<div style="text-align:right;margin-top:10px;"><a href="' . api_get_path(WEB_CODE_PATH) . 'mySpace/course.php?follow">' . get_lang('SeeMore') . '</a></div>';
$content .= '<div style="text-align:right;margin-top:10px;"><a href="'.api_get_path(WEB_CODE_PATH).'mySpace/course.php?follow">'.get_lang('SeeMore').'</a></div>';
}
//$content .= '</div>';
@ -163,7 +163,7 @@ class BlockCourse extends Block
// students directly subscribed to the course
$sql = "SELECT user_id FROM $tbl_course_user as course_rel_user
WHERE course_rel_user.status=" . STUDENT . " AND course_rel_user.c_id='$courseId'";
WHERE course_rel_user.status=".STUDENT." AND course_rel_user.c_id='$courseId'";
$rs = Database::query($sql);
$users = array();
while ($row = Database::fetch_array($rs)) {
@ -182,7 +182,7 @@ class BlockCourse extends Block
);
if (!empty($tematic_advance)) {
$tematic_advance_progress = '<a title="' . get_lang('GoToThematicAdvance') . '" href="' . api_get_path(WEB_CODE_PATH) . 'course_progress/index.php?cidReq=' . $course_code . '&action=thematic_details">' . $tematic_advance . '%</a>';
$tematic_advance_progress = '<a title="'.get_lang('GoToThematicAdvance').'" href="'.api_get_path(WEB_CODE_PATH).'course_progress/index.php?cidReq='.$course_code.'&action=thematic_details">'.$tematic_advance.'%</a>';
} else {
$tematic_advance_progress = '0%';
}

@ -39,7 +39,7 @@ class BlockEvaluationGraph extends Block
$this->bg_height = 350;
if ($this->is_block_visible_for_user($user_id)) {
if (!api_is_session_admin()) {
$this->courses = CourseManager::get_courses_followed_by_drh($user_id);
$this->courses = CourseManager::get_courses_followed_by_drh($user_id);
}
$this->sessions = SessionManager::get_sessions_followed_by_drh($user_id);
}
@ -78,13 +78,13 @@ class BlockEvaluationGraph extends Block
$html = '<div class="panel panel-default" id="intro">
<div class="panel-heading">
'.get_lang('EvaluationsGraph').'
<div class="pull-right"><a class="btn btn-danger btn-xs" onclick="javascript:if(!confirm(\''.addslashes(api_htmlentities(get_lang('ConfirmYourChoice'),ENT_QUOTES,$charset)).'\')) return false;" href="index.php?action=disable_block&path='.$this->path.'">
<div class="pull-right"><a class="btn btn-danger btn-xs" onclick="javascript:if(!confirm(\''.addslashes(api_htmlentities(get_lang('ConfirmYourChoice'), ENT_QUOTES, $charset)).'\')) return false;" href="index.php?action=disable_block&path='.$this->path.'">
<em class="fa fa-times"></em>
</a></div>
</div>
<div class="panel-body">';
if (empty($evaluations_base_courses_graph) && empty($evaluations_courses_in_sessions_graph)) {
$html .= '<p>'.api_convert_encoding(get_lang('GraphicNotAvailable'),'UTF-8').'</p>';
$html .= '<p>'.api_convert_encoding(get_lang('GraphicNotAvailable'), 'UTF-8').'</p>';
} else {
// display evaluations base courses graph
if (!empty($evaluations_base_courses_graph)) {
@ -132,7 +132,7 @@ class BlockEvaluationGraph extends Block
$alleval = $cats[0]->get_evaluations(null, true, $course_code);
$alllinks = $cats[0]->get_links(null, true);
$users = GradebookUtils::get_all_users($alleval, $alllinks);
$datagen = new FlatViewDataGenerator ($users, $alleval, $alllinks);
$datagen = new FlatViewDataGenerator($users, $alleval, $alllinks);
$evaluation_sumary = $datagen->get_evaluation_sumary_results();
if (!empty($evaluation_sumary)) {
$items = array_keys($evaluation_sumary);
@ -158,16 +158,16 @@ class BlockEvaluationGraph extends Block
$dataSet->normalize(100, '%');
$dataSet->loadPalette(api_get_path(SYS_CODE_PATH) . 'palettes/pchart/default.color', true);
$dataSet->loadPalette(api_get_path(SYS_CODE_PATH).'palettes/pchart/default.color', true);
// Cache definition
$cachePath = api_get_path(SYS_ARCHIVE_PATH);
$myCache = new pCache(array('CacheFolder' => substr($cachePath, 0, strlen($cachePath) - 1)));
$chartHash = $myCache->getHash($dataSet);
if ($myCache->isInCache($chartHash)) {
$imgPath = api_get_path(SYS_ARCHIVE_PATH) . $chartHash;
$imgPath = api_get_path(SYS_ARCHIVE_PATH).$chartHash;
$myCache->saveFromCache($chartHash, $imgPath);
$imgPath = api_get_path(WEB_ARCHIVE_PATH) . $chartHash;
$imgPath = api_get_path(WEB_ARCHIVE_PATH).$chartHash;
} else {
/* Create the pChart object */
$widthSize = $this->bg_width;
@ -196,7 +196,7 @@ class BlockEvaluationGraph extends Block
/* Set the default font */
$myPicture->setFontProperties(
array(
'FontName' => api_get_path(SYS_FONTS_PATH) . 'opensans/OpenSans-Regular.ttf',
'FontName' => api_get_path(SYS_FONTS_PATH).'opensans/OpenSans-Regular.ttf',
'FontSize' => 10
)
);
@ -276,12 +276,12 @@ class BlockEvaluationGraph extends Block
/* Write and save into cache */
$myCache->writeToCache($chartHash, $myPicture);
$imgPath = api_get_path(SYS_ARCHIVE_PATH) . $chartHash;
$imgPath = api_get_path(SYS_ARCHIVE_PATH).$chartHash;
$myCache->saveFromCache($chartHash, $imgPath);
$imgPath = api_get_path(WEB_ARCHIVE_PATH) . $chartHash;
$imgPath = api_get_path(WEB_ARCHIVE_PATH).$chartHash;
}
if (!empty($imgPath)) {
$courses_graph[$course_code] = '<img src="' . $imgPath . '">';
$courses_graph[$course_code] = '<img src="'.$imgPath.'">';
}
}
}
@ -310,7 +310,7 @@ class BlockEvaluationGraph extends Block
$alleval = $cats[0]->get_evaluations(null, true, $course_code);
$alllinks = $cats[0]->get_links(null, true);
$users = GradebookUtils::get_all_users($alleval, $alllinks);
$datagen = new FlatViewDataGenerator ($users, $alleval, $alllinks);
$datagen = new FlatViewDataGenerator($users, $alleval, $alllinks);
$evaluation_sumary = $datagen->get_evaluation_sumary_results();
if (!empty($evaluation_sumary)) {
$items = array_keys($evaluation_sumary);
@ -336,16 +336,16 @@ class BlockEvaluationGraph extends Block
$dataSet->normalize(100, '%');
$dataSet->loadPalette(api_get_path(SYS_CODE_PATH) . 'palettes/pchart/default.color', true);
$dataSet->loadPalette(api_get_path(SYS_CODE_PATH).'palettes/pchart/default.color', true);
// Cache definition
$cachePath = api_get_path(SYS_ARCHIVE_PATH);
$myCache = new pCache(array('CacheFolder' => substr($cachePath, 0, strlen($cachePath) - 1)));
$chartHash = $myCache->getHash($dataSet);
if ($myCache->isInCache($chartHash)) {
$imgPath = api_get_path(SYS_ARCHIVE_PATH) . $chartHash;
$imgPath = api_get_path(SYS_ARCHIVE_PATH).$chartHash;
$myCache->saveFromCache($chartHash, $imgPath);
$imgPath = api_get_path(WEB_ARCHIVE_PATH) . $chartHash;
$imgPath = api_get_path(WEB_ARCHIVE_PATH).$chartHash;
} else {
/* Create the pChart object */
$widthSize = $this->bg_width;
@ -374,7 +374,7 @@ class BlockEvaluationGraph extends Block
/* Set the default font */
$myPicture->setFontProperties(
array(
'FontName' => api_get_path(SYS_FONTS_PATH) . 'opensans/OpenSans-Regular.ttf',
'FontName' => api_get_path(SYS_FONTS_PATH).'opensans/OpenSans-Regular.ttf',
'FontSize' => 10
)
);
@ -448,12 +448,12 @@ class BlockEvaluationGraph extends Block
/* Write and save into cache */
$myCache->writeToCache($chartHash, $myPicture);
$imgPath = api_get_path(SYS_ARCHIVE_PATH) . $chartHash;
$imgPath = api_get_path(SYS_ARCHIVE_PATH).$chartHash;
$myCache->saveFromCache($chartHash, $imgPath);
$imgPath = api_get_path(WEB_ARCHIVE_PATH) . $chartHash;
$imgPath = api_get_path(WEB_ARCHIVE_PATH).$chartHash;
}
if (!empty($imgPath)) {
$courses_graph[$course_code] = '<img src="' . $imgPath . '">';
$courses_graph[$course_code] = '<img src="'.$imgPath.'">';
}
}
}

@ -10,7 +10,7 @@
*/
//the plugin title
$plugin_info['title'] = 'Enable or disable logout button';
$plugin_info['title'] = 'Enable or disable logout button';
//the comments that go with the plugin
$plugin_info['comment'] = "If you use some other authentication than local Chamilo authentication, you may have to disable the Chamilo logout button and give users information about your SSO logout.";
@ -23,8 +23,8 @@ $form = new FormValidator('eaclbb_form');
$form->addElement("html", "<div class='normal-message'>Fill the text boxes below to overwrite the default values used in this plugin</div>");
$form->addElement('text', 'eaclbb_form_link_url', 'Page to load when clicking on the logout button');
$form->addElement('text', 'eaclbb_form_link_infobulle', 'Tooltip text for the logout button (displayed on mouseover)');
$form->addElement('checkbox', 'eaclbb_form_link_image', "Display the logout button disabled (black and white)", "", array('checked' => true));
$form->addElement('checkbox', 'eaclbb_form_alert_onoff', "Display an alert when clicking on the logout button", "", array('checked' => true));
$form->addElement('checkbox', 'eaclbb_form_link_image', "Display the logout button disabled (black and white)", "", array('checked' => true));
$form->addElement('checkbox', 'eaclbb_form_alert_onoff', "Display an alert when clicking on the logout button", "", array('checked' => true));
$form->addElement('text', 'eaclbb_form_alert_text', "Text displayed in the alert box when clickng on the logout button (if checkbox above has been checked).");
$form->addButtonSave(get_lang('Save'), 'submit_button');
@ -44,4 +44,4 @@ $form->setDefaults($defaults);
$plugin_info['settings_form'] = $form;
// Set the templates that are going to be used
$plugin_info['templates'] = array('template.tpl');
$plugin_info['templates'] = array('template.tpl');

@ -24,7 +24,7 @@ header('Content-Type: text/html; charset=utf-8');
$imageFormat = "PNG";
$cookies = null;
foreach (array_keys($_COOKIE) as $cookieName) {
$cookies.=bin2hex($cookieName)."=".bin2hex($_COOKIE[$cookieName]).";";
$cookies .= bin2hex($cookieName)."=".bin2hex($_COOKIE[$cookieName]).";";
}
$pageName = 'file';

@ -7,7 +7,7 @@
* @package chamilo.plugin.kannelsms
* @author Imanol Losada <imanol.losada@beeznest.com>
*/
require_once __DIR__ . '/../../main/inc/global.inc.php';
require_once __DIR__.'/../../main/inc/global.inc.php';
require_once 'lib/kannelsms.lib.php';
require_once 'vendor/kannelsms_api.php';

@ -75,14 +75,13 @@ class Kannelsms implements SmsPluginLibraryInterface
$trimmedKey = trim(CONFIG_SECURITY_API_KEY);
if (!empty($trimmedKey)) {
$message = array(
"to" => array_key_exists("mobilePhoneNumber",$additionalParameters) ?
$additionalParameters['mobilePhoneNumber'] :
$this->getMobilePhoneNumberById($additionalParameters['userId']),
"to" => array_key_exists("mobilePhoneNumber", $additionalParameters) ?
$additionalParameters['mobilePhoneNumber'] : $this->getMobilePhoneNumberById($additionalParameters['userId']),
"message" => $this->getSms($additionalParameters)
);
if (!empty($message['message'])) {
if(extension_loaded('curl')) {
if (extension_loaded('curl')) {
$url = $this->hostAddress.'?username='.
$this->username.'&password='.$this->password.'&from='.
$this->from.'&to='.$message['to'].'&msg='.urlencode($message['message']);

@ -47,8 +47,8 @@ class OpenMeetingsGateway
$this->rest = new OpenMeetingsRestService();
$err = $this->rest->getError();
if ($err) {
error_log('Constructor error: ' . $err);
error_log('Debug: ' . $this->rest->getDebug());;
error_log('Constructor error: '.$err);
error_log('Debug: '.$this->rest->getDebug()); ;
exit();
}
}
@ -59,7 +59,7 @@ class OpenMeetingsGateway
*/
public function getRestUrl($name)
{
return $this->getUrl() . "/services/" . $name . "/";
return $this->getUrl()."/services/".$name."/";
}
/**
@ -89,30 +89,30 @@ class OpenMeetingsGateway
public function loginUser()
{
$returnValue = 0;
$response = $this->rest->call($this->getRestUrl("UserService") . "getSession", "session_id");
$response = $this->rest->call($this->getRestUrl("UserService")."getSession", "session_id");
if ($this->rest->getError()) {
error_log('Fault (Expect - The request contains an invalid SOAP body) '.print_r($response, 1));
} else {
$err = $this->rest->getError();
if ($err) {
error_log('Error: ' . $err);
error_log('Error: '.$err);
} else {
//error_log('getSession returned '.$response. ' - Storing as sessionId');
$this->sessionId = $response;
$url = $this->getRestUrl("UserService")
. "loginUser?"
. "SID=" . $this->sessionId
. "&username=" . $this->_user
. "&userpass=" . $this->_pass;
. "SID=".$this->sessionId
. "&username=".$this->_user
. "&userpass=".$this->_pass;
$result = $this->rest->call($url);
if ($this->rest->getError()) {
error_log('Fault (Expect - The request contains an invalid SOAP body) '.print_r($result, 1));
} else {
$err = $this->rest->getError();
if ($err) {
error_log('Error '. $err);
error_log('Error '.$err);
} else {
$returnValue = $result;
}
@ -135,8 +135,8 @@ class OpenMeetingsGateway
{
$err = $this->rest->getError();
if ($err) {
error_log('Constructor error: ' . $err);
error_log('Debug: ' . $this->rest->getDebug());
error_log('Constructor error: '.$err);
error_log('Debug: '.$this->rest->getDebug());
exit();
}
@ -146,17 +146,17 @@ class OpenMeetingsGateway
}
$url = $this->getRestUrl($this->getRestUrl("RoomService")
. "updateRoomWithModeration?SID=" . $this->sessionId
. "&room_id=" . $room->room_id
. "&name=" . urlencode($room->name)
. "&roomtypes_id=" . $room->roomtypes_id
. "&comment=" . $room->comment
. "&numberOfPartizipants=" . $room->numberOfPartizipants
. "updateRoomWithModeration?SID=".$this->sessionId
. "&room_id=".$room->room_id
. "&name=".urlencode($room->name)
. "&roomtypes_id=".$room->roomtypes_id
. "&comment=".$room->comment
. "&numberOfPartizipants=".$room->numberOfPartizipants
. "&ispublic=false"
. "&appointment=false"
. "&isDemoRoom=false"
. "&demoTime=0"
. "&isModeratedRoom=" . $this->var_to_str($isModeratedRoom));
. "&isModeratedRoom=".$this->var_to_str($isModeratedRoom));
//error_log($url);
$result = $this->rest->call($url);
@ -165,14 +165,14 @@ class OpenMeetingsGateway
} else {
$err = $this->rest->getError();
if ($err) {
error_log('Error: ' . $err);
error_log('Error: '.$err);
} else {
// echo '<h2>Result</h2><pre>'; print_r($result["return"]); echo '</pre>';
//error_log('Room updated successfully '.print_r($result,1));
return $result;
}
}
return - 1;
return -1;
}
/**
@ -188,13 +188,13 @@ class OpenMeetingsGateway
{
$result = $this->rest->call($this->getRestUrl("UserService")
. 'setUserObjectAndGenerateRecordingHashByURL?'
. 'SID=' . $this->sessionId
. '&username=' . urlencode($username)
. '&firstname=' . urlencode($firstname)
. '&lastname=' . urlencode($lastname)
. '&externalUserId=' . $userId
. '&externalUserType=' . urlencode($systemType)
. '&recording_id=' . $recording_id, 'return');
. 'SID='.$this->sessionId
. '&username='.urlencode($username)
. '&firstname='.urlencode($firstname)
. '&lastname='.urlencode($lastname)
. '&externalUserId='.$userId
. '&externalUserType='.urlencode($systemType)
. '&recording_id='.$recording_id, 'return');
if ($result->fault) {
error_log('Fault (Expect - The request contains an invalid SOAP body) '.print_r($result, 1));
@ -206,7 +206,7 @@ class OpenMeetingsGateway
return $result;
}
}
return - 1;
return -1;
}
/**
@ -226,28 +226,28 @@ class OpenMeetingsGateway
{
$err = $this->rest->getError();
if ($err) {
error_log('Constructor error: ' . $err);
error_log('Debug: ' . $this->rest->getDebug());;
error_log('Constructor error: '.$err);
error_log('Debug: '.$this->rest->getDebug()); ;
exit();
}
$result = $this->rest->call($this->getRestUrl("UserService")
. "setUserObjectAndGenerateRoomHashByURLAndRecFlag?"
. "SID=" . $this->sessionId
. "&username=" . urlencode($username)
. "&firstname=" . urlencode($firstname)
. "&lastname=" . urlencode($lastname)
. "&profilePictureUrl=" . urlencode($profilePictureUrl)
. "&email=" . urlencode($email)
. "&externalUserId=" . urlencode($userId)
. "&externalUserType=" . urlencode($systemType)
. "&room_id=" . urlencode($room_id)
. "&becomeModeratorAsInt=" . $becomeModerator
. "SID=".$this->sessionId
. "&username=".urlencode($username)
. "&firstname=".urlencode($firstname)
. "&lastname=".urlencode($lastname)
. "&profilePictureUrl=".urlencode($profilePictureUrl)
. "&email=".urlencode($email)
. "&externalUserId=".urlencode($userId)
. "&externalUserType=".urlencode($systemType)
. "&room_id=".urlencode($room_id)
. "&becomeModeratorAsInt=".$becomeModerator
. "&showAudioVideoTestAsInt=1"
. "&allowRecording=" . $this->var_to_str($allowRecording));
. "&allowRecording=".$this->var_to_str($allowRecording));
if ($result->fault) {
error_log('Fault (Expect - The request contains an invalid SOAP body) '.print_r($result,1));
error_log('Fault (Expect - The request contains an invalid SOAP body) '.print_r($result, 1));
} else {
$err = $this->rest->getError();
if ($err) {
@ -257,7 +257,7 @@ class OpenMeetingsGateway
return $result;
}
}
return - 1;
return -1;
}
/**
@ -268,15 +268,15 @@ class OpenMeetingsGateway
{
$err = $this->rest->getError();
if ($err) {
error_log('Constructor error: ' . $err);
error_log('Debug: ' . $this->rest->getDebug());
error_log('Constructor error: '.$err);
error_log('Debug: '.$this->rest->getDebug());
exit();
}
$url = $this->getRestUrl("RoomService")."deleteRoom?SID=".$this->sessionId."&rooms_id=".$openmeetings->room_id;
$result = $this->rest->call($url);
if ($result->fault) {
error_log('Fault (Expect - The request contains an invalid SOAP body) '.print_r($result,1));
error_log('Fault (Expect - The request contains an invalid SOAP body) '.print_r($result, 1));
} else {
$err = $this->rest->getError();
if ($err) {
@ -287,7 +287,7 @@ class OpenMeetingsGateway
return $result;
}
}
return - 1;
return -1;
}
/**
@ -297,20 +297,20 @@ class OpenMeetingsGateway
{
$result = $this->rest->call($this->getRestUrl("UserService")
. "setUserObjectAndGenerateRoomHash?"
. "SID=" . $this->sessionId
. "&username=" . urlencode($username)
. "&firstname=" . urlencode($firstname)
. "&lastname=" . urlencode($lastname)
. "&profilePictureUrl=" . urlencode($profilePictureUrl)
. "&email=" . urlencode($email)
. "&externalUserId=" . urlencode($externalUserId)
. "&externalUserType=" . urlencode($externalUserType)
. "&room_id=" . $room_id
. "&becomeModeratorAsInt=" . $becomeModeratorAsInt
. "&showAudioVideoTestAsInt=" . $showAudioVideoTestAsInt);
. "SID=".$this->sessionId
. "&username=".urlencode($username)
. "&firstname=".urlencode($firstname)
. "&lastname=".urlencode($lastname)
. "&profilePictureUrl=".urlencode($profilePictureUrl)
. "&email=".urlencode($email)
. "&externalUserId=".urlencode($externalUserId)
. "&externalUserType=".urlencode($externalUserType)
. "&room_id=".$room_id
. "&becomeModeratorAsInt=".$becomeModeratorAsInt
. "&showAudioVideoTestAsInt=".$showAudioVideoTestAsInt);
if ($result->getError()) {
error_log('Fault (Expect - The request contains an invalid SOAP body) '.print_r($result,1));
error_log('Fault (Expect - The request contains an invalid SOAP body) '.print_r($result, 1));
} else {
$err = $this->rest->getError();
if ($err) {
@ -320,7 +320,7 @@ class OpenMeetingsGateway
return $result;
}
}
return - 1;
return -1;
}
/**
@ -338,29 +338,29 @@ class OpenMeetingsGateway
}
$url = $this->getRestUrl("RoomService")
. $service.'?'
. 'SID=' . $room->SID
. '&name=' . $room->name
. '&roomtypes_id=' . $room->roomtypes_id
. '&comment='. $room->comment
. '&numberOfPartizipants=' . $room->numberOfPartizipants
. '&ispublic=' . $this->var_to_str($room->ispublic)
. '&appointment=' . $this->var_to_str($room->appointment)
. '&isDemoRoom=' . $this->var_to_str($room->isDemoRoom)
. '&demoTime=' . $room->demoTime
. '&isModeratedRoom=' . $this->var_to_str($room->isModeratedRoom)
. '&externalRoomType=' . $room->externalRoomType;
. 'SID='.$room->SID
. '&name='.$room->name
. '&roomtypes_id='.$room->roomtypes_id
. '&comment='.$room->comment
. '&numberOfPartizipants='.$room->numberOfPartizipants
. '&ispublic='.$this->var_to_str($room->ispublic)
. '&appointment='.$this->var_to_str($room->appointment)
. '&isDemoRoom='.$this->var_to_str($room->isDemoRoom)
. '&demoTime='.$room->demoTime
. '&isModeratedRoom='.$this->var_to_str($room->isModeratedRoom)
. '&externalRoomType='.$room->externalRoomType;
if ($room->allowRecording) {
$url .= '&allowUserQuestions=' . $this->var_to_str($room->allowUserQuestions)
. '&isAudioOnly=' . $this->var_to_str($room->isAudioOnly)
. '&waitForRecording=' . $this->var_to_str($room->waitForRecording)
. '&allowRecording=' . $this->var_to_str($room->allowRecording);
$url .= '&allowUserQuestions='.$this->var_to_str($room->allowUserQuestions)
. '&isAudioOnly='.$this->var_to_str($room->isAudioOnly)
. '&waitForRecording='.$this->var_to_str($room->waitForRecording)
. '&allowRecording='.$this->var_to_str($room->allowRecording);
} elseif ($room->isAudioOnly) {
$url .= '&isAudioOnly=' . $this->var_to_str($room->isAudioOnly);
$url .= '&isAudioOnly='.$this->var_to_str($room->isAudioOnly);
}
$result = $this->rest->call($url);
if ($this->rest->fault) {
error_log('Fault (Expect - The request contains an invalid SOAP body) '.print_r($result,1));
error_log('Fault (Expect - The request contains an invalid SOAP body) '.print_r($result, 1));
} else {
$err = $this->rest->getError();
if ($err) {
@ -385,7 +385,7 @@ class OpenMeetingsGateway
return false;
}
$url = $this->getRestUrl("RoomService") . "getRoomsWithCurrentUsersByListAndType?SID=" . $this->sessionId
$url = $this->getRestUrl("RoomService")."getRoomsWithCurrentUsersByListAndType?SID=".$this->sessionId
. "&start=1&max=1000&orderby=name&asc=true&externalRoomType=chamilolms";
//$url = $this->getRestUrl("RoomService")
// . "getRoomTypes?"
@ -396,7 +396,7 @@ class OpenMeetingsGateway
$rooms = array();
foreach ($result as $room) {
//error_log(__FILE__.'+'.__LINE__.': one room found on remote: '.print_r($room,1));
if ($room['externalRoomType'] == $type && count($room['currentusers']) > 0 ) {
if ($room['externalRoomType'] == $type && count($room['currentusers']) > 0) {
$rooms[] = $room;
}
}
@ -418,7 +418,7 @@ class OpenMeetingsGateway
$url = $this->getRestUrl("RoomService")
. "getRoomById?"
. "SID=" . $this->sessionId
. "SID=".$this->sessionId
. "&rooms_id=".$roomId;
//error_log(__FILE__.'+'.__LINE__.' Calling WS: '.$url);
$result = $this->rest->call($url, "return");
@ -432,8 +432,8 @@ class OpenMeetingsGateway
{
$url = $this->getRestUrl("RoomService")
. "getFlvRecordingByExternalRoomType?"
. "SID=" . $this->sessionId
. "&externalRoomType=" . urlencode($this->config["moduleKey"]);
. "SID=".$this->sessionId
. "&externalRoomType=".urlencode($this->config["moduleKey"]);
$result = $this->rest->call($url, "return");
@ -449,8 +449,8 @@ class OpenMeetingsGateway
{
$url = $this->getRestUrl("RoomService")
. "getFlvRecordingByRoomId?"
. "SID=" . $this->sessionId
. "&roomId=" . urlencode($id);
. "SID=".$this->sessionId
. "&roomId=".urlencode($id);
$result = $this->rest->call($url, "return");
@ -464,8 +464,8 @@ class OpenMeetingsGateway
{
$url = $this->getRestUrl("RoomService")
. "getFlvRecordingByExternalUserId?"
. "SID=" . $this->sessionId
. "&externalUserId=" . $id;
. "SID=".$this->sessionId
. "&externalUserId=".$id;
$result = $this->rest->call($url, "return");

@ -5,6 +5,6 @@
* @author Imanol Losada Oriol <imanol.losada@beeznest.com>
* @package chamilo.plugin.resubscription
*/
require_once __DIR__ . '/config.php';
require_once __DIR__.'/config.php';
Resubscription::create()->install();

Loading…
Cancel
Save