Format code + use api_get_user_info()

1.10.x
Julio Montoya 10 years ago
parent f175a68a45
commit 1433d42058
  1. 25
      main/auth/conditional_login/complete_phone_number.php
  2. 3
      main/exercice/tests_category.php
  3. 6
      main/gradebook/index.php
  4. 2
      main/inc/global.inc.php
  5. 2
      main/inc/lib/blog.lib.php
  6. 2
      main/inc/local.inc.php
  7. 2
      main/messages/inbox.php
  8. 3
      main/messages/view_message.php
  9. 4
      main/mySpace/myStudents.php
  10. 3
      main/social/friends.php
  11. 2
      main/social/myfiles.php
  12. 4
      main/survey/fillsurvey.php
  13. 3
      plugin/advanced_subscription/src/admin_view.php
  14. 3
      src/Chamilo/CoreBundle/Component/Editor/CkEditor/CkEditor.php

@ -21,10 +21,29 @@ if (! isset($_SESSION['conditional_login']['uid']))
</html>
<?php
if (isset($_POST['submit'])){
$u = UserManager::get_user_info_by_id($_SESSION['conditional_login']['uid']);
$u = api_get_user_info($_SESSION['conditional_login']['uid']);
$u['phone'] = $_POST['phone_number'];
$password = null; // we don't want to change the password
$updated = UserManager::update_user($u['user_id'], $u['firstname'], $u['lastname'], $u['username'], $password, $u['auth_source'], $u['email'], $u['status'], $u['official_code'], $u['phone'], $u['picture_uri'], $u['expiration_date'], $u['active'], $u['creator_id'], $u['hr_dept_id'], $u['extra'], $u['language'],'');
$password = null; // we don't want to change the password
$updated = UserManager::update_user(
$u['user_id'],
$u['firstname'],
$u['lastname'],
$u['username'],
$password,
$u['auth_source'],
$u['email'],
$u['status'],
$u['official_code'],
$u['phone'],
$u['picture_uri'],
$u['expiration_date'],
$u['active'],
$u['creator_id'],
$u['hr_dept_id'],
$u['extra'],
$u['language'],
''
);
if ($updated) {
ConditionalLogin::login();
}

@ -64,10 +64,9 @@ function edit_category_form($in_action) {
$category_id = Security::remove_XSS($_GET['category_id']);
$objcat = new TestCategory($category_id);
// initiate the object
$form = new FormValidator('note', 'post', api_get_self() . '?action=' . $in_action . '&category_id=' . $category_id);
// settting the form elements
// Setting the form elements
$form->addElement('header', get_lang('EditCategory'));
$form->addElement('hidden', 'category_id');
$form->addElement('text', 'category_name', get_lang('CategoryName'), array('size' => '95'));

@ -14,9 +14,9 @@ $current_course_tool = TOOL_GRADEBOOK;
api_protect_course_script(true);
$course_code = api_get_course_id();
$stud_id = api_get_user_id();
$session_id = api_get_session_id();
$course_code = api_get_course_id();
$stud_id = api_get_user_id();
$session_id = api_get_session_id();
//make sure the destination for scripts is index.php instead of gradebook.php
$_SESSION['gradebook_dest'] = 'index.php';

@ -126,9 +126,9 @@ $dbParams = array(
'password' => $_configuration['db_password'],
'dbname' => $_configuration['main_database'],
);
try {
$database = new \Database();
$database->connect($dbParams);
} catch (Exception $e) {
$global_error_code = 3;

@ -2057,7 +2057,7 @@ class Blog
$user['user_id'] = $user['id_user'];
}
if(!in_array($user['user_id'],$blog_member_ids)) {
$a_infosUser = UserManager :: get_user_info_by_id($user['user_id']);
$a_infosUser = api_get_user_info($user['user_id']);
$row = array ();
$row[] = '<input type="checkbox" name="user[]" value="' . $a_infosUser['user_id'] . '" '.((isset($_GET['selectall']) && $_GET['selectall'] == "subscribe") ? ' checked="checked" ' : '') . '/>';
$username = api_htmlentities(sprintf(get_lang('LoginX'), $a_infosUser["username"]), ENT_QUOTES);

@ -117,7 +117,7 @@ use ChamiloSession as Session;
if (isset($_SESSION['conditional_login']['uid']) &&
$_SESSION['conditional_login']['can_login'] === true
) {
$uData = UserManager::get_user_info_by_id($_SESSION['conditional_login']['uid']);
$uData = api_get_user_info($_SESSION['conditional_login']['uid']);
ConditionalLogin::check_conditions($uData);
$_user['user_id'] = $_SESSION['conditional_login']['uid'];

@ -124,7 +124,7 @@ if (isset($_GET['f']) && $_GET['f'] == 'social' || api_get_setting('allow_social
$actions .= '<a href="'.api_get_path(WEB_PATH).'main/messages/outbox.php">'.Display::return_icon('outbox.png', get_lang('Outbox')).'</a>';
}
}
$userInfo = UserManager::get_user_info_by_id($user_id);
//LEFT CONTENT
if (api_get_setting('allow_social_tool') == 'true') {
//Block Social Menu

@ -55,8 +55,7 @@ if (empty($_GET['id'])) {
$message = '';
//LEFT COLUMN
$userInfo = UserManager::get_user_info_by_id($user_id);
// LEFT COLUMN
if (api_get_setting('allow_social_tool') == 'true') {
//Block Social Menu
$social_menu_block = SocialManager::show_social_menu($show_menu);

@ -452,8 +452,8 @@ if (!empty($student_id)) {
$info_course['tutor_name'] = implode(",",$info_tutor_name);
} elseif ($session_coach_id != 0) {
$session_coach_id = intval($session_info['id_coach']);
$coach_info = UserManager::get_user_info_by_id($session_coach_id);
$info_course['tutor_name'] = api_get_person_name($coach_info['firstname'], $coach_info['lastname']);
$coach_info = api_get_user_info($session_coach_id);
$info_course['tutor_name'] = $coach_info['complete_name'];
}
$coachs_name = $info_course['tutor_name'];
$session_name = $session_info['name'];

@ -78,8 +78,7 @@ function clear_form () {
$interbreadcrumb[] = array('url' => 'profile.php', 'name' => get_lang('SocialNetwork'));
$interbreadcrumb[] = array('url' => '#', 'name' => get_lang('Friends'));
//Block Social Avatar
$user_info = UserManager::get_user_info_by_id($user_id);
//Block Social Menu
$social_menu_block = SocialManager::show_social_menu('friends');

@ -127,8 +127,6 @@ if (is_array($_GET) && count($_GET) > 0) {
}
}
}
//Social Avatar BLock
$user_info = UserManager::get_user_info_by_id($user_id);
//Social Menu Block
$social_menu_block = SocialManager::show_social_menu('myfiles');

@ -368,7 +368,7 @@ $user_id = api_get_user_id();
if ($user_id == 0) {
$user_id = $survey_invitation['user'];
}
$user_data = UserManager :: get_user_info_by_id($user_id);
$user_data = api_get_user_info($user_id);
if ($survey_data['form_fields'] != '' && $survey_data['anonymous'] == 0 && is_array($user_data)) {
$form_fields = explode('@', $survey_data['form_fields']);
@ -492,7 +492,7 @@ if ($survey_data['form_fields'] != '' && $survey_data['anonymous'] == 0 && is_ar
// EXTRA FIELDS
$extra_data = UserManager :: get_extra_user_data($user_id, true);
UserManager::set_extra_fields_in_form($form, $extra_data, 'profile');
UserManager::set_extra_fields_in_form($form, $extra_data);
$form->addButtonNext(get_lang('Next'));
$user_data = array_merge($user_data, $extra_data);

@ -60,7 +60,8 @@ if (!empty($sessionId)) {
foreach ($studentList['students'] as &$student) {
$studentId = intval($student['user_id']);
$data['studentUserId'] = $studentId;
$student['area'] = UserManager::get_user_info_by_id($studentId)['extra']['area'];
$student['area'] = api_get_user_info($studentId)['extra']['area'];
$student['userLink'] = api_get_path(WEB_CODE_PATH).'social/profile.php?u='.$studentId;
$data['queueId'] = intval($student['queue_id']);
$data['newStatus'] = ADVANCED_SUBSCRIPTION_QUEUE_STATUS_ADMIN_APPROVED;

@ -151,7 +151,8 @@ class CkEditor extends Editor
'html' => $content
);
}
//var_dump($templateList);
return json_encode($templateList);
}
}

Loading…
Cancel
Save