コード例 #1
0
ファイル: configure_ui.php プロジェクト: anzhao/CLAS
function getClassList($classID)
{
    //print "classID: $classID";
    $users = new users();
    $classList = $users->getClassList($classID, false);
    $users->close();
    //print_r($classList);
    return $classList;
}
コード例 #2
0
ファイル: logout.php プロジェクト: anzhao/CLAS
<?php

require_once dirname(__FILE__) . "/includes/global_deploy_config.php";
require_once dirname(__FILE__) . "/includes/common.inc.php";
require_once dirname(__FILE__) . "/database/users.php";
startSession();
// log session end
$users = new users();
$users->recordLogout($_SESSION['user_id']);
$users->close();
// end PHP session
endSession();
// kill Shibboleth session
header("Location: {$logoutURL}");
exit;
コード例 #3
0
 *  Copyright (C) 2014  Shane Dawson, University of South Australia, Australia
 *  Copyright (C) 2014  An Zhao, University of South Australia, Australia
 *  Copyright (C) 2014  Dragan Gasevic, University of Edinburgh, United Kingdom
 *  Copyright (C) 2014  Negin Mirriahi, University of New South Wales, Australia
 *  Copyright (C) 2014  Abelardo Pardo, University of Sydney, Australia
 *  Copyright (C) 2014  Alan Kingstone, University of British Columbia, Canada
 *  Copyright (C) 2014  Thomas Dang, , University of British Columbia, Canada
 *  Copyright (C) 2014 John Bratlien, University of British Columbia, Canada 
 *
 *  This program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by 
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>
 */
require_once dirname(__FILE__) . "/../includes/common.inc.php";
require_once dirname(__FILE__) . "/../database/users.php";
startSession();
// TODO: validate input
$groupID = $_GET['group_id'];
$user = new users();
$groupMembers = $user->getGroupMembers($groupID);
$user->close();
print json_encode($groupMembers);
コード例 #4
0
ファイル: clas_adm.php プロジェクト: abelardopardo/oval
function UTIL_setDefaultUISettings($userIDs, $verbose = true)
{
    // Set the UI setting, put the "time to show annotation parameter here"
    $users = new users();
    foreach ($userIDs as $ID) {
        $users->setUI($ID, "annotation", "yes", "by-default", 0);
    }
    $users->close();
    if ($verbose) {
        print "<b>Set default UI settings for all users added so far</b><br/><br/>";
    }
}
コード例 #5
0
ファイル: media.php プロジェクト: abelardopardo/oval
 function setVideoGroup($videoID, $groupID)
 {
     //print "setVideoGroup($videoID, $groupID)";
     // TODO: multiple groups per video is NOT yet possible!
     // Does videoGroup need a to use both groupID and videoID as a primary key or can we
     // just use an ID? Currently we can't just insert more entries into videoGroup
     if (is_null($this->getVideoGroup($videoID))) {
         $query = "INSERT INTO videoGroup VALUES ('{$videoID}', {$groupID})";
     } else {
         // this would return an error if more than one group in a video
         $query = "UPDATE videoGroup SET group_id={$groupID} WHERE video_id LIKE '{$videoID}'";
     }
     $result = mysql_query($query, $this->link);
     //print "query: $query<br />";
     if (!$result) {
         die('Invalid query (setVideoGroup): ' . mysql_error());
     }
     //$this->removeVideoGroup($videoID);
     $users = new users();
     $students = $users->getGroupMembers($groupID);
     $instructorsAndTAs = $users->getClassInstructorsAndTAs($groupID);
     $userIDs = array_merge($students, $instructorsAndTAs);
     // grant ownership of video to course instructor and TAs
     $groupOwners = $users->getClassInstructorsAndTAs($groupID);
     $users->close();
     // empty videoOwners before repopulating
     $this->removeVideoOwners($videoID);
     foreach ($groupOwners as $owner) {
         $query = "INSERT INTO videoOwners VALUES ('{$videoID}', {$owner})";
         $result = mysql_query($query, $this->link);
         if (!$result) {
             die('Invalid query (setVideoGroup - adding video owners): ' . mysql_error());
         }
     }
     $this->removeAllUsersFromVideo($videoID);
     $this->addUsersToVideo($videoID, $groupID, $userIDs);
 }