当前位置: 首页>>代码示例>>PHP>>正文


PHP UserManager::get_user_info_by_id方法代码示例

本文整理汇总了PHP中UserManager::get_user_info_by_id方法的典型用法代码示例。如果您正苦于以下问题:PHP UserManager::get_user_info_by_id方法的具体用法?PHP UserManager::get_user_info_by_id怎么用?PHP UserManager::get_user_info_by_id使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在UserManager的用法示例。


在下文中一共展示了UserManager::get_user_info_by_id方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: get_user_name

    public function get_user_name($username, $password, $id, $field)
    {
        if($this->verifyUserPass($username, $password) == "valid")
        {
            $userInfo = UserManager::get_user_info_by_id($id);
            switch ($field)
            {

                case 'firstname':
                    return $userInfo['firstname'];
                    break;
                case 'lastname' :
                    return $userInfo['lastname'];
                    break;
                case 'bothfl' :
                    return $userInfo['firstname']." ".$userInfo['lastname'];
                    break;
                case 'bothlf' :
                    return $userInfo['lastname']." ".$userInfo['firstname'];
                    break;
                default :
                    return $userInfo['firstname'];
            }
            return "0";
        }
        return "0";
    }
开发者ID:annickvdp,项目名称:Chamilo1.9.10,代码行数:27,代码来源:cm_webservice_user.php

示例2: get_announcement_data

 public function get_announcement_data($username, $password, $course_code, $announcement_id, $field)
 {
     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)) {
             $announcements[] = $announcement;
         }
         switch ($field) {
             case 'sender':
                 $field_table = "insert_user_id";
                 $sender = UserManager::get_user_info_by_id($announcements[0][$field_table]);
                 $announcements[0][$field_table] = $sender['firstname'] . " " . $sender['lastname'];
                 break;
             case 'title':
                 $htmlcode = true;
                 $field_table = "title";
                 break;
             case 'date':
                 $field_table = "end_date";
                 break;
             case 'content':
                 $htmlcode = true;
                 $field_table = "content";
                 $announcements[0][$field_table] = nl2br_revert($announcements[0][$field_table]);
                 break;
             default:
                 $field_table = "title";
         }
         return htmlcode ? html_entity_decode($announcements[0][$field_table]) : $announcements[0][$field_table];
     } else {
         return get_lang('InvalidId');
     }
 }
开发者ID:ilosada,项目名称:chamilo-lms-icpna,代码行数:35,代码来源:cm_webservice_announcements.php

示例3: dc_check_phone_number

function dc_check_phone_number($user)
{
    $uInfo = UserManager::get_user_info_by_id($user['user_id']);
    if (empty($uInfo['phone'])) {
        return false;
    }
    return true;
}
开发者ID:ilosada,项目名称:chamilo-lms-icpna,代码行数:8,代码来源:conditional_login.php

示例4: display_form_user_subscribe

 /**
  * Displays the form to register users in a blog (in a course)
  * The listed users are users subcribed in the course.
  * @author Toon Keppens
  *
  * @param Integer $blog_id
  *
  * @return Html Form with sortable table with users to subcribe in a blog, in a course.
  */
 public static function display_form_user_subscribe($blog_id)
 {
     // Init
     global $_course;
     $is_western_name_order = api_is_western_name_order();
     $currentCourse = $_course['sysCode'];
     $tbl_users = Database::get_main_table(TABLE_MAIN_USER);
     $tbl_blogs_rel_user = Database::get_course_table(TABLE_BLOGS_REL_USER);
     $table_course_user = Database::get_main_table(TABLE_MAIN_COURSE_USER);
     echo '<legend>' . get_lang('SubscribeMembers') . '</legend>';
     $course_id = api_get_course_int_id();
     $properties["width"] = "100%";
     // Get blog members' id.
     $sql = "SELECT user.user_id FROM {$tbl_users} user\n\t\t\t\tINNER JOIN {$tbl_blogs_rel_user} blogs_rel_user\n\t\t\t\tON user.user_id = blogs_rel_user.user_id\n\t\t\t\tWHERE blogs_rel_user.c_id = {$course_id} AND blogs_rel_user.blog_id = '" . intval($blog_id) . "'";
     $result = Database::query($sql);
     $blog_member_ids = array();
     while ($user = Database::fetch_array($result)) {
         $blog_member_ids[] = $user['user_id'];
     }
     // Set table headers
     $column_header[] = array('', false, '');
     if ($is_western_name_order) {
         $column_header[] = array(get_lang('FirstName'), true, '');
         $column_header[] = array(get_lang('LastName'), true, '');
     } else {
         $column_header[] = array(get_lang('LastName'), true, '');
         $column_header[] = array(get_lang('FirstName'), true, '');
     }
     $column_header[] = array(get_lang('Email'), false, '');
     $column_header[] = array(get_lang('Register'), false, '');
     if (isset($_SESSION['session_id'])) {
         $session_id = intval($_SESSION['session_id']);
     } else {
         $session_id = 0;
     }
     $student_list = CourseManager::get_student_list_from_course_code($currentCourse, false, $session_id);
     $user_data = array();
     // Add users that are not in this blog to the list.
     foreach ($student_list as $key => $user) {
         if (isset($user['id_user'])) {
             $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']);
             $row = array();
             $row[] = '<input type="checkbox" name="user[]" value="' . $a_infosUser['user_id'] . '" ' . ($_GET['selectall'] == "subscribe" ? ' checked="checked" ' : '') . '/>';
             $username = api_htmlentities(sprintf(get_lang('LoginX'), $a_infosUser["username"]), ENT_QUOTES);
             if ($is_western_name_order) {
                 $row[] = $a_infosUser["firstname"];
                 $row[] = Display::tag('span', $a_infosUser["lastname"], array('title' => $username));
             } else {
                 $row[] = Display::tag('span', $a_infosUser["lastname"], array('title' => $username));
                 $row[] = $a_infosUser["firstname"];
             }
             $row[] = Display::icon_mailto_link($a_infosUser["email"]);
             //Link to register users
             if ($a_infosUser["user_id"] != $_SESSION['_user']['user_id']) {
                 $row[] = "<a class=\"btn \" href=\"" . api_get_self() . "?action=manage_members&amp;blog_id={$blog_id}&amp;register=yes&amp;user_id=" . $a_infosUser["user_id"] . "\">" . get_lang('Register') . "</a>";
             } else {
                 $row[] = '';
             }
             $user_data[] = $row;
         }
     }
     // Display
     $query_vars['action'] = 'manage_members';
     $query_vars['blog_id'] = $blog_id;
     echo '<form method="post" action="blog.php?action=manage_members&amp;blog_id=' . $blog_id . '">';
     Display::display_sortable_table($column_header, $user_data, null, null, $query_vars);
     $link = '';
     $link .= isset($_GET['action']) ? 'action=' . Security::remove_XSS($_GET['action']) . '&amp;' : '';
     $link .= "blog_id={$blog_id}&amp;";
     echo '<a href="blog.php?' . $link . 'selectall=subscribe">' . get_lang('SelectAll') . '</a> - ';
     echo '<a href="blog.php?' . $link . '">' . get_lang('UnSelectAll') . '</a> ';
     echo get_lang('WithSelected') . ' : ';
     echo '<select name="action">';
     echo '<option value="select_subscribe">' . get_lang('Register') . '</option>';
     echo '</select>';
     echo '<input type="hidden" name="register" value="true" />';
     echo '<button class="save" type="submit">' . get_lang('Ok') . '</button>';
     echo '</form>';
 }
开发者ID:annickvdp,项目名称:Chamilo1.9.10,代码行数:91,代码来源:blog.lib.php

示例5: store_add_dropbox


//.........这里部分代码省略.........
    if ($thisIsAMailing && count($_POST['recipients']) != 1) {
        return get_lang('MailingSelectNoOther');
    }
    // we are doing a just upload but an additional recipient is selected.
    // note: why can't this be valid? It is like sending a document to yourself AND to a different person (I do this quite often with my e-mails)
    if ($thisIsJustUpload && count($_POST['recipients']) != 1) {
        return get_lang('MailingJustUploadSelectNoOther');
    }
    if (empty($_FILES['file']['name'])) {
        $error = true;
        return get_lang('NoFileSpecified');
    }
    // are we overwriting a previous file or sending a new one
    $dropbox_overwrite = false;
    if (isset($_POST['cb_overwrite']) && $_POST['cb_overwrite']) {
        $dropbox_overwrite = true;
    }
    // doing the upload
    $dropbox_filename = $_FILES['file']['name'];
    $dropbox_filesize = $_FILES['file']['size'];
    $dropbox_filetype = $_FILES['file']['type'];
    $dropbox_filetmpname = $_FILES['file']['tmp_name'];
    // check if the filesize does not exceed the allowed size.
    if ($dropbox_filesize <= 0 || $dropbox_filesize > $dropbox_cnf['maxFilesize']) {
        return get_lang('DropboxFileTooBig');
        // TODO: The "too big" message does not fit in the case of uploading zero-sized file.
    }
    // check if the file is actually uploaded
    if (!is_uploaded_file($dropbox_filetmpname)) {
        // check user fraud : no clean error msg.
        return get_lang('TheFileIsNotUploaded');
    }
    $upload_ok = process_uploaded_file($_FILES['file'], true);
    if (!$upload_ok) {
        return null;
    }
    // Try to add an extension to the file if it hasn't got one
    $dropbox_filename = add_ext_on_mime($dropbox_filename, $dropbox_filetype);
    // Replace dangerous characters
    $dropbox_filename = replace_dangerous_char($dropbox_filename);
    // Transform any .php file in .phps fo security
    $dropbox_filename = php2phps($dropbox_filename);
    //filter extension
    if (!filter_extension($dropbox_filename)) {
        return get_lang('UplUnableToSaveFileFilteredExtension');
    }
    // set title
    $dropbox_title = $dropbox_filename;
    // set author
    if (!isset($_POST['authors'])) {
        $_POST['authors'] = getUserNameFromId($_user['user_id']);
    }
    // note: I think we could better migrate everything from here on to separate functions: store_new_dropbox, store_new_mailing, store_just_upload
    if ($dropbox_overwrite) {
        $dropbox_person = new Dropbox_Person($_user['user_id'], api_is_course_admin(), api_is_course_tutor());
        foreach ($dropbox_person->sentWork as $w) {
            if ($w->title == $dropbox_filename) {
                if ($w->recipients[0]['id'] > dropbox_cnf('mailingIdBase') xor $thisIsAMailing) {
                    return get_lang('MailingNonMailingError');
                }
                if ($w->recipients[0]['id'] == $_user['user_id'] xor $thisIsJustUpload) {
                    return get_lang('MailingJustUploadSelectNoOther');
                }
                $dropbox_filename = $w->filename;
                $found = true;
                // note: do we still need this?
                break;
            }
        }
    } else {
        // rename file to login_filename_uniqueId format
        $dropbox_filename = getLoginFromId($_user['user_id']) . "_" . $dropbox_filename . "_" . uniqid('');
    }
    // creating the array that contains all the users who will receive the file
    $new_work_recipients = array();
    foreach ($_POST['recipients'] as $rec) {
        if (strpos($rec, 'user_') === 0) {
            $new_work_recipients[] = substr($rec, strlen('user_'));
        } elseif (strpos($rec, 'group_') === 0) {
            $userList = GroupManager::get_subscribed_users(substr($rec, strlen('group_')));
            foreach ($userList as $usr) {
                if (!in_array($usr['user_id'], $new_work_recipients) && $usr['user_id'] != $_user['user_id']) {
                    $new_work_recipients[] = $usr['user_id'];
                }
            }
        }
    }
    @move_uploaded_file($dropbox_filetmpname, dropbox_cnf('sysPath') . '/' . $dropbox_filename);
    $b_send_mail = api_get_course_setting('email_alert_on_new_doc_dropbox');
    if ($b_send_mail) {
        foreach ($new_work_recipients as $recipient_id) {
            $recipent_temp = UserManager::get_user_info_by_id($recipient_id);
            $additionalParameters = array('smsType' => ClockworksmsPlugin::NEW_FILE_SHARED_COURSE_BY, 'userId' => $recipient_id, 'courseTitle' => $_course['title'], 'userUsername' => $recipent_temp['username']);
            api_mail_html(api_get_person_name($recipent_temp['firstname'] . ' ' . $recipent_temp['lastname'], null, PERSON_NAME_EMAIL_ADDRESS), $recipent_temp['email'], get_lang('NewDropboxFileUploaded'), get_lang('NewDropboxFileUploadedContent') . ' ' . api_get_path(WEB_CODE_PATH) . 'dropbox/index.php?cidReq=' . $_course['sysCode'] . "\n\n" . api_get_person_name($_user['firstName'], $_user['lastName'], null, PERSON_NAME_EMAIL_ADDRESS) . "\n" . get_lang('Email') . " : " . $_user['mail'], api_get_person_name($_user['firstName'], $_user['lastName'], null, PERSON_NAME_EMAIL_ADDRESS), $_user['mail'], null, null, null, $additionalParameters);
        }
    }
    new Dropbox_SentWork($_user['user_id'], $dropbox_title, $_POST['description'], strip_tags($_POST['authors']), $dropbox_filename, $dropbox_filesize, $new_work_recipients);
    Security::clear_token();
    return get_lang('FileUploadSucces');
}
开发者ID:annickvdp,项目名称:Chamilo1.9.10,代码行数:101,代码来源:dropbox_functions.inc.php

示例6: array

    $allowed_picture_types = array('jpg', 'jpeg', 'png', 'gif');
    $form->addRule('picture', get_lang('OnlyImagesAllowed') . ' (' . implode(',', $allowed_picture_types) . ')', 'filetype', $allowed_picture_types);
    $form->addElement('style_submit_button', 'apply_change', get_lang('SaveSettings'), 'class="save"');
    if ($form->validate()) {
        $user_data = $form->getSubmitValues();
        // upload picture if a new one is provided
        if ($_FILES['picture']['size']) {
            if ($new_picture = UserManager::update_user_picture(api_get_user_id(), $_FILES['picture']['name'], $_FILES['picture']['tmp_name'])) {
                $table_user = Database::get_main_table(TABLE_MAIN_USER);
                $sql = "UPDATE {$table_user} SET picture_uri = '{$new_picture}' WHERE user_id =  " . api_get_user_id();
                $result = Database::query($sql);
            }
        }
    }
}
$user_info = UserManager::get_user_info_by_id(api_get_user_id());
$social_left_content = SocialManager::show_social_menu('home');
$usergroup = new UserGroup();
$social_right_content = '<div class="span5">';
$social_right_content .= '<div class="well_border">';
$social_right_content .= '<h3>' . get_lang('ContactInformation') . '</h3>';
$list = array(array('title' => get_lang('Name'), 'content' => api_get_person_name($user_info['firstname'], $user_info['lastname'])), array('title' => get_lang('Email'), 'content' => $user_info['email']));
// Current user information
$social_right_content .= '<div>' . Display::description($list) . '</div>';
$social_right_content .= '
        <div class="form-actions">
            <a class="btn" href="' . api_get_path(WEB_PATH) . 'main/auth/profile.php">
                ' . get_lang('EditProfile') . '
            </a>
        </div>
    </div>';
开发者ID:ragebat,项目名称:chamilo-lms,代码行数:31,代码来源:home.php

示例7: accept

 /**
  * Returns true if authentication accepts to run otherwise returns false.
  * 
  * @return boolean 
  */
 public function accept()
 {
     /**
      * Authentication method must be enabled 
      */
     if (!self::is_enabled()) {
         return false;
     }
     $token = $this->get_access_token();
     if ($token->is_empty()) {
         return false;
     }
     $key = UserApiKeyManager::get_by_id($token->get_id());
     if (empty($key)) {
         return false;
     }
     /**
      * The service corresponding to the key must be enabled. 
      */
     $service = $key['api_service'];
     if (!self::is_service_enabled($service)) {
         return false;
     }
     /**
      * User associated with the key must be active 
      */
     $user = UserManager::get_user_info_by_id($token->get_user_id());
     if (empty($user)) {
         return false;
     }
     if (!$user['active']) {
         return false;
     }
     /**
      * Token must be valid. 
      */
     return $token->is_valid();
 }
开发者ID:annickvdp,项目名称:Chamilo1.9.10,代码行数:43,代码来源:key_auth.class.php

示例8: WSGetUser

function WSGetUser($params)
{
    global $debug;
    if ($debug) {
        error_log('WSGetUser');
    }
    if ($debug) {
        error_log('$params: ' . print_r($params, 1));
    }
    if (!WSHelperVerifyKey($params)) {
        return return_error(WS_ERROR_SECRET_KEY);
    }
    $result = array();
    // Get user id
    $user_id = UserManager::get_user_id_from_original_id($params['original_user_id_value'], $params['original_user_id_name']);
    $user_data = UserManager::get_user_info_by_id($user_id);
    if (empty($user_data)) {
        // If user was not found, there was a problem
        $result['user_id'] = '';
        $result['firstname'] = '';
        $result['lastname'] = '';
    } else {
        $result['user_id'] = $user_data['user_id'];
        $result['firstname'] = $user_data['firstname'];
        $result['lastname'] = $user_data['lastname'];
    }
    return $result;
}
开发者ID:ilosada,项目名称:chamilo-lms-icpna,代码行数:28,代码来源:registration.soap.php

示例9: get_lang

 $table->set_header(2, get_lang('FirstName'), false, 'align="center"');
 $table->set_header(3, get_lang('TrainingTime'), false);
 $table->set_header(4, get_lang('CourseProgress'), false);
 $table->set_header(5, get_lang('Score'), false);
 $table->set_header(6, get_lang('Student_publication'), false);
 $table->set_header(7, get_lang('Messages'), false);
 $table->set_header(8, get_lang('FirstLogin'), false, 'align="center"');
 $table->set_header(9, get_lang('LatestLogin'), false, 'align="center"');
 $table->set_header(10, get_lang('Details'), false);
 if ($export_csv) {
     $csv_content[] = array();
 }
 $all_datas = array();
 $course_code = $_course['id'];
 foreach ($a_students as $student_id => $student) {
     $student_datas = UserManager::get_user_info_by_id($student_id);
     $avg_time_spent = $avg_student_score = $avg_student_progress = $total_assignments = $total_messages = 0;
     $nb_courses_student = 0;
     $avg_time_spent = Tracking::get_time_spent_on_the_course($student_id, $course_code);
     $avg_student_score = Tracking::get_average_test_scorm_and_lp($student_id, $course_code);
     $avg_student_progress = Tracking::get_avg_student_progress($student_id, $course_code);
     $total_assignments = Tracking::count_student_assignments($student_id, $course_code);
     $total_messages = Tracking::count_student_messages($student_id, $course_code);
     $row = array();
     $row[] = $student_datas['official_code'];
     $row[] = $student_datas['lastname'];
     $row[] = $student_datas['firstname'];
     $row[] = api_time_to_hms($avg_time_spent);
     if (is_null($avg_student_score)) {
         $avg_student_score = 0;
     }
开发者ID:RusticiSoftware,项目名称:SCORMCloud_DokeosMod,代码行数:31,代码来源:courseLog.php

示例10: realpath

<?php

/*
 * This file is part of the Libcast Dokeos module.
 *
 * (c) Libcast <contact@libcast.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
// This file is not for production, only for tests and developments,
// thus, we stop here.
die;
require_once realpath(__DIR__ . '/../inc/global.inc.php');
require_once realpath(__DIR__ . '/../inc/lib/course.lib.php');
require_once realpath(__DIR__ . '/../inc/lib/usermanager.lib.php');
error_reporting(E_ALL);
ini_set('display_errors', true);
$u = UserManager::get_user_info_by_id(isset($_GET['user_id']) ? $_GET['user_id'] : 4);
$_SESSION['_user'] = $u;
header('Location: http://scandola.univ-corse.fr/dokeos/index.php');
开发者ID:libcast,项目名称:dokeos-libcast,代码行数:21,代码来源:masquerade.php

示例11: api_get_path

$url = api_get_path(WEB_PATH) . 'main/auth/conditional_login/complete_phone_number.php';
if (!isset($_SESSION['conditional_login']['uid'])) {
    die("Not Authorised");
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="fr" xml:lang="fr" xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body>
  <form id="data_completion" name="data_completion" method="post" action="<?php 
echo $url;
?>
">
        Téléphone : <input type="text" name="phone_number" />
        <input type="submit" name="submit" value="Submit" />
    </form>
  </body>
</html>
<?php 
if (isset($_POST['submit'])) {
    $u = UserManager::get_user_info_by_id($_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'], '');
    if ($updated) {
        ConditionalLogin::login();
    }
}
开发者ID:ilosada,项目名称:chamilo-lms-icpna,代码行数:31,代码来源:complete_phone_number.php

示例12: get_tickets_by_user_id


//.........这里部分代码省略.........
                            SELECT user_id FROM $table_main_admin
                            )
                        AND ticket.status_id != 'REE'
                    GROUP BY ticket.ticket_id)";
            }
        }
        $sql .= " ORDER BY col$column $direction";
        $sql .= " LIMIT $from,$number_of_items";

        $result = Database::query($sql);
        $tickets = array();
        $webPath = api_get_path(WEB_PATH);
        $webCodePath = api_get_path(WEB_CODE_PATH);
        while ($row = Database::fetch_assoc($result)) {
            $sql_unread = "SELECT
                              COUNT(DISTINCT message.message_id) AS unread
                           FROM $table_support_tickets  ticket,
                                $table_support_messages message,
                                $table_main_user user
                           WHERE ticket.ticket_id = message.ticket_id
                           AND ticket.ticket_id = '{$row['col0']}'
                           AND message.status = 'NOL'
                           AND message.sys_insert_user_id = user.user_id ";
            if ($isAdmin) {
                $sql_unread .= " AND user.user_id
                                 NOT IN (SELECT user_id FROM $table_main_admin)
                                 AND ticket.status_id != 'REE' ";
            } else {
                $sql_unread .= " AND user.user_id
                                 IN (SELECT user_id FROM $table_main_admin) ";
            }
            $result_unread = Database::query($sql_unread);
            $unread = Database::fetch_object($result_unread)->unread;
            $userInfo = UserManager::get_user_info_by_id($row['user_id']);
            $hrefUser = $webPath . 'main/admin/user_information.php?user_id=' . $row['user_id'];
            $name = "<a href='$hrefUser'> {$userInfo['username']} </a>";
            $actions = "";

            if ($row['responsible'] != 0) {
                $row['responsible'] = api_get_user_info($row['responsible']);
                if (!empty($row['responsible'])) {
                    $hrefResp = $webPath . 'main/admin/user_information.php?user_id=' . $row['responsible']['user_id'];
                    $row['responsible'] = "<a href='$hrefResp'> {$row['responsible']['username']} </a>";
                } else {
                    $row['responsible'] = get_lang('UnknownUser');
                }

            } else {
                if ($row['status_id'] != 'REE') {
                    $row['responsible'] = '<span style="color:#ff0000;">' . $plugin->get_lang('ToBeAssigned') . '</span>';
                } else {
                    $row['responsible'] = '<span style="color:#00ff00;">' . get_lang('MessageResent') . '</span>';
                }
            }

            switch ($row['source']) {
                case 'PRE':
                    $img_source = 'icons/32/user.png';
                    break;
                case 'MAI':
                    $img_source = 'icons/32/mail.png';
                    break;
                case 'TEL':
                    $img_source = 'icons/32/event.png';
                    break;
                default:
开发者ID:annickvdp,项目名称:Chamilo1.9.10,代码行数:67,代码来源:ticket.class.php

示例13: get_tickets_by_user_id

    public static function get_tickets_by_user_id($from, $number_of_items, $column, $direction, $user_id = null)
    {
        $table_support_category = Database::get_main_table(TABLE_SUPPORT_CATEGORY);
        $table_support_tickets = Database::get_main_table(TABLE_SUPPORT_TICKET);
        $table_support_priority = Database::get_main_table(TABLE_SUPPORT_PRIORITY);
        $table_support_status = Database::get_main_table(TABLE_SUPPORT_STATUS);
        $table_support_messages = Database::get_main_table(TABLE_SUPPORT_MESSAGE);
        $table_main_user = Database::get_main_table(TABLE_MAIN_USER);
        $table_main_admin = Database::get_main_table(TABLE_MAIN_ADMIN);
        if (is_null($direction)) {
            $direction = "DESC";
        }
        if (is_null($user_id) || $user_id == 0) {
            $user_id = api_get_user_id();
        }
        $isAdmin = UserManager::is_admin($user_id);
        $sql = "SELECT ticket.*,  ticket.ticket_id AS col0,ticket.start_date AS col1, ticket.sys_lastedit_datetime AS col2 ,cat.name AS col3,user.username AS col4, priority.priority AS col5 ,\n\t\t\t\tpriority.priority  AS col6, status.name AS col7 , ticket.total_messages AS col8, msg.message AS col9, ticket.request_user AS user_id , ticket.assigned_last_user AS responsable \n\t\t\t\tFROM " . $table_support_tickets . " ticket ," . $table_support_category . " cat , " . $table_support_priority . " priority, " . $table_support_status . " status , " . Database::get_main_table(TABLE_MAIN_USER) . " user, tck_message msg \n\t\t\t\tWHERE cat.category_id = ticket.category_id AND ticket.priority_id = priority.priority_id AND ticket.status_id = status.status_id  AND user.user_id = ticket.request_user\n\t\t\t\tAND ticket.ticket_id= msg.ticket_id AND message_id=1 ";
        if (!$isAdmin) {
            $sql .= " AND request_user = '{$user_id}' ";
        }
        $keyword_unread = Database::escape_string(trim($_GET['keyword_unread']));
        //Search simple
        if (isset($_GET['submit_simple'])) {
            if ($_GET['keyword'] != '') {
                $keyword = Database::escape_string(trim($_GET['keyword']));
                $sql .= " AND (ticket.ticket_code = '" . $keyword . "' OR ticket.ticket_id = '" . $keyword . "' OR user.firstname LIKE '%" . $keyword . "%' OR user.lastname LIKE '%" . $keyword . "%'  OR concat(user.firstname,' ',user.lastname) LIKE '%" . $keyword . "%'  OR concat(user.lastname,' ',user.firstname) LIKE '%" . $keyword . "%' OR user.username LIKE '%" . $keyword . "%')  ";
            }
        }
        //Search advanced
        if (isset($_GET['submit_advanced'])) {
            $keyword_category = Database::escape_string(trim($_GET['keyword_category']));
            $keyword_request_user = Database::escape_string(trim($_GET['keyword_request_user']));
            $keyword_admin = Database::escape_string(trim($_GET['keyword_admin']));
            $keyword_start_date_start = Database::escape_string(trim($_GET['keyword_start_date_start']));
            $keyword_start_date_end = Database::escape_string(trim($_GET['keyword_start_date_end']));
            $keyword_status = Database::escape_string(trim($_GET['keyword_status']));
            $keyword_source = Database::escape_string(trim($_GET['keyword_source']));
            $keyword_priority = Database::escape_string(trim($_GET['keyword_priority']));
            $keyword_range = Database::escape_string(trim($_GET['keyword_dates']));
            $keyword_course = Database::escape_string(trim($_GET['keyword_course']));
            if ($keyword_category != '') {
                $sql .= " AND ticket.category_id = '{$keyword_category}'  ";
            }
            if ($keyword_request_user != '') {
                $sql .= " AND (ticket.request_user = '{$keyword_request_user}' OR user.firstname LIKE '%" . $keyword_request_user . "%' OR user.official_code LIKE '%" . $keyword_request_user . "%' OR user.lastname LIKE '%" . $keyword_request_user . "%'  OR concat(user.firstname,' ',user.lastname) LIKE '%" . $keyword_request_user . "%'  OR concat(user.lastname,' ',user.firstname) LIKE '%" . $keyword_request_user . "%' OR user.username LIKE '%" . $keyword_request_user . "%') ";
            }
            if ($keyword_admin != '') {
                $sql .= " AND ticket.assigned_last_user = '{$keyword_admin}'  ";
            }
            if ($keyword_status != '') {
                $sql .= " AND ticket.status_id = '{$keyword_status}'  ";
            }
            if ($keyword_range == '' && $keyword_start_date_start != '') {
                $sql .= " AND DATE_FORMAT( ticket.start_date,'%d/%m/%Y') = '{$keyword_start_date_start}' ";
            }
            if ($keyword_range == '1' && $keyword_start_date_start != '' && $keyword_start_date_end != '') {
                $sql .= " AND DATE_FORMAT( ticket.start_date,'%d/%m/%Y') >= '{$keyword_start_date_start}' AND DATE_FORMAT( ticket.start_date,'%d/%m/%Y') <= '{$keyword_start_date_end}'";
            }
            if ($keyword_priority != '') {
                $sql .= " AND ticket.priority_id = '{$keyword_priority}'  ";
            }
            if ($keyword_source != '') {
                $sql .= " AND ticket.source = '{$keyword_source}' ";
            }
            if ($keyword_priority != '') {
                $sql .= " AND ticket.priority_id = '{$keyword_priority}' ";
            }
            if ($keyword_course != '') {
                $course_table = Database::get_main_table(TABLE_MAIN_COURSE);
                $sql .= " AND ticket.course_id IN ( ";
                $sql .= "SELECT id FROM {$course_table} WHERE (title LIKE '%" . $keyword_course . "%' OR code LIKE '%" . $keyword_course . "%' OR visual_code LIKE '%" . $keyword_course . "%' )) ";
            }
        }
        if ($keyword_unread == 'yes') {
            $sql .= " AND ticket.ticket_id IN (SELECT ticket.ticket_id FROM  {$table_support_tickets} ticket,  {$table_support_messages} message,  {$table_main_user} user WHERE ticket.ticket_id = message.ticket_id   AND message.status = 'NOL'   AND message.sys_insert_user_id = user.user_id   AND user.user_id NOT IN (SELECT user_id FROM {$table_main_admin})    AND ticket.status_id != 'REE'   GROUP BY ticket.ticket_id)";
        } else {
            if ($keyword_unread == 'no') {
                $sql .= " AND ticket.ticket_id NOT IN (SELECT ticket.ticket_id FROM  {$table_support_tickets} ticket,  {$table_support_messages} message,  {$table_main_user} user WHERE ticket.ticket_id = message.ticket_id   AND message.status = 'NOL'   AND message.sys_insert_user_id = user.user_id   AND user.user_id NOT IN (SELECT user_id FROM {$table_main_admin})   AND ticket.status_id != 'REE'   GROUP BY ticket.ticket_id)";
            }
        }
        $sql .= " ORDER BY col{$column} {$direction}";
        $sql .= " LIMIT {$from},{$number_of_items}";
        $result = Database::query($sql);
        $tickets = array();
        while ($row = Database::fetch_assoc($result)) {
            $sql_unread = "SELECT COUNT(DISTINCT message.message_id) AS unread FROM " . $table_support_tickets . "  ticket, " . $table_support_messages . " message, " . $table_main_user . " user\n \t\t\tWHERE ticket.ticket_id = message.ticket_id AND ticket.ticket_id= '" . $row['col0'] . "' AND message.status='NOL' AND message.sys_insert_user_id = user.user_id ";
            if ($isAdmin) {
                $sql_unread .= " AND user.user_id  NOT IN (SELECT user_id FROM {$table_main_admin})   AND ticket.status_id != 'REE' ";
            } else {
                $sql_unread .= " AND user.user_id IN (SELECT user_id FROM {$table_main_admin})   ";
            }
            $result_unread = Database::query($sql_unread);
            $unread = Database::fetch_object($result_unread)->unread;
            $userinfo = UserManager::get_user_info_by_id($row['user_id']);
            $name = '<a href="' . api_get_path(WEB_PATH) . 'main/admin/user_information.php?user_id=' . $row['user_id'] . '">' . api_get_person_name($userinfo['firstname'], $userinfo['lastname']) . '</a>';
            $actions = "";
            /*if($row['status_id']!='CLS' && $row['status_id']!='REE'){						
            			if( $row['responsable'] != 0 && $row['responsable'] == $user_id ){
            				$actions = '<a href="myticket.php?ticket_id='.$row['ticket_id'].'&amp;action=unassign" title="desasignarme"><img src="../../../main/img/admin_star.png" border="0" /></a>';					
            			}else{	
//.........这里部分代码省略.........
开发者ID:ragebat,项目名称:chamilo-lms,代码行数:101,代码来源:ticket.class.php

示例14: send_notification_for_oral_questions

 function send_notification_for_oral_questions($question_list_answers, $origin, $exe_id)
 {
     if (api_get_course_setting('email_alert_manager_on_new_quiz') != 2) {
         return null;
     }
     // Email configuration settings
     $courseCode = api_get_course_id();
     $course_info = api_get_course_info($courseCode);
     $url_email = api_get_path(WEB_CODE_PATH) . 'exercice/exercise_show.php?' . api_get_cidreq() . '&id_session=' . api_get_session_id() . '&id=' . $exe_id . '&action=qualify';
     $user_info = UserManager::get_user_info_by_id(api_get_user_id());
     $oral_question_list = null;
     foreach ($question_list_answers as $item) {
         $question = $item['question'];
         $answer = $item['answer'];
         $answer_type = $item['answer_type'];
         if (!empty($question) && !empty($answer) && $answer_type == ORAL_EXPRESSION) {
             $oral_question_list .= '<br /><table width="730" height="136" border="0" cellpadding="3" cellspacing="3"><tr>
                         <td width="220" valign="top" bgcolor="#E5EDF8">&nbsp;&nbsp;' . get_lang('Question') . '</td>
                         <td width="473" valign="top" bgcolor="#F3F3F3">' . $question . '</td>
                     </tr>
                     <tr>
                         <td width="220" valign="top" bgcolor="#E5EDF8">&nbsp;&nbsp;' . get_lang('Answer') . '</td>
                         <td valign="top" bgcolor="#F3F3F3">' . $answer . '</td>
                     </tr></table>';
         }
     }
     if (!empty($oral_question_list)) {
         $msg = '<p>' . get_lang('OralQuestionsAttempted') . ' :</p>
                 <p>' . get_lang('AttemptDetails') . ' : </p>
                 <table class="data_table">
                     <tr>
                         <td><h3>' . get_lang('CourseName') . '</h3></td>
                         <td><h3>#course#</h3></td>
                     </tr>
                     <tr>
                         <td>' . get_lang('TestAttempted') . '</span></td>
                         <td>#exercise#</td>
                     </tr>
                     <tr>
                         <td>' . get_lang('StudentName') . '</td>
                         <td>#firstName# #lastName#</td>
                     </tr>
                     <tr>
                         <td>' . get_lang('StudentEmail') . '</td>
                         <td>#mail#</td>
                     </tr>
                 </table>';
         $msg .= '<br />' . sprintf(get_lang('OralQuestionsAttemptedAreX'), $oral_question_list) . '<br />';
         $msg1 = str_replace("#exercise#", $this->exercise, $msg);
         $msg = str_replace("#firstName#", $user_info['firstname'], $msg1);
         $msg1 = str_replace("#lastName#", $user_info['lastname'], $msg);
         $msg = str_replace("#mail#", $user_info['email'], $msg1);
         $msg = str_replace("#course#", $course_info['name'], $msg1);
         if ($origin != 'learnpath') {
             $msg .= get_lang('ClickToCommentAndGiveFeedback') . ', <br />
                         <a href="#url#">#url#</a>';
         }
         $msg1 = str_replace("#url#", $url_email, $msg);
         $mail_content = $msg1;
         $subject = get_lang('OralQuestionsAttempted');
         if (api_get_session_id()) {
             $teachers = CourseManager::get_coach_list_from_course_code($courseCode, api_get_session_id());
         } else {
             $teachers = CourseManager::get_teacher_list_from_course_code($courseCode);
         }
         if (!empty($teachers)) {
             foreach ($teachers as $user_id => $teacher_data) {
                 MessageManager::send_message_simple($user_id, $subject, $mail_content);
             }
         }
     }
 }
开发者ID:annickvdp,项目名称:Chamilo1.9.10,代码行数:72,代码来源:exercise.class.php

示例15: realpath

<?php

/*
 * This file is part of the Libcast Dokeos module.
 *
 * (c) Libcast <contact@libcast.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
require_once realpath(__DIR__ . '/../inc/global.inc.php');
require_once realpath(__DIR__ . '/../inc/lib/usermanager.lib.php');
require_once realpath(__DIR__ . '/../inc/lib/course.lib.php');
if (!($userId = strtolower(htmlspecialchars($_GET['id'])))) {
    return;
}
if (!($user = UserManager::get_user_info_by_id($userId))) {
    return;
}
$libcast->synchronizeUser($user);
开发者ID:libcast,项目名称:dokeos-libcast,代码行数:20,代码来源:sync.php


注:本文中的UserManager::get_user_info_by_id方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。