예제 #1
0
// Rogō 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 Rogō.  If not, see <http://www.gnu.org/licenses/>.
/**
* 
* @author Simon Wilkinson
* @version 1.0
* @copyright Copyright (c) 2014 The University of Nottingham
* @package
*/
require '../../include/invigilator_auth.inc';
require_once '../../include/errors.inc';
require_once '../../classes/paperutils.class.php';
require_once '../../classes/userutils.class.php';
require_once '../../classes/toiletbreakutils.class.php';
$userID = check_var('userID', 'POST', true, false, true);
$paperID = check_var('paperID', 'POST', true, false, true);
// Does the paper exist?
if (!Paper_utils::paper_exists($paperID, $mysqli)) {
    exit;
}
// Does the student exist?
if (!UserUtils::userid_exists($userID, $mysqli)) {
    exit;
}
ToiletBreaks::add_toilet_break($userID, $paperID, $mysqli);
$mysqli->close();
예제 #2
0
* Delete a user account.
*
* @author Simon Wilkinson
* @version 1.0
* @copyright Copyright (c) 2014 The University of Nottingham
* @package
*/
require '../include/sysadmin_auth.inc';
require_once '../include/errors.inc';
require_once '../classes/userutils.class.php';
$userID = check_var('id', 'POST', true, false, true);
// Check that all the past user IDs actually exist.
$id_list = explode(',', $userID);
foreach ($id_list as $id) {
    if ($id != '') {
        if (!UserUtils::userid_exists($id, $mysqli)) {
            $msg = sprintf($string['furtherassistance'], $configObject->get('support_email'), $configObject->get('support_email'));
            $notice->display_notice_and_exit($mysqli, $string['pagenotfound'], $msg, $string['pagenotfound'], '../artwork/page_not_found.png', '#C00000', true, true);
        }
    }
}
foreach ($id_list as $single_id) {
    if ($single_id != '') {
        UserUtils::delete_userID($single_id, $mysqli);
    }
}
$mysqli->close();
?>
<!DOCTYPE html>
<html>
<head>
예제 #3
0
 $cols = explode(',', $separate_line);
 if ($line_no == 0) {
     // Read the header row
     $heading = $cols;
     $col_no = count($cols);
     echo "<tr><th></th><th>Username</th><th colspan=\"3\">Student Name</th>";
     for ($i = 1; $i < $col_no; $i++) {
         echo "<th>" . trim($heading[$i]) . "</th>";
     }
     echo "</tr>\n";
 } else {
     // 'username' can be either the real username or sid
     $username = trim($cols[0]);
     // Check see if user was found
     if (!isset($student_id_array[$username])) {
         if (UserUtils::userid_exists($username, $mysqli) or UserUtils::username_exists($username, $mysqli)) {
             echo "<tr><td><img src=\"../artwork/red_cross_16.png\" wodth=\"16\" height=\"16\" alt=\"Failed\" /></td><td class=\"failed\">{$username}</td><td colspan=\"" . (3 + $col_no) . "\" class=\"failed\" style=\"text-align:center\">&lt;user not registered on " . module_utils::get_moduleid_from_id($_GET['module'], $mysqli) . "&gt;</td>";
         } else {
             echo "<tr><td><img src=\"../artwork/red_cross_16.png\" wodth=\"16\" height=\"16\" alt=\"Failed\" /></td><td class=\"failed\">{$username}</td><td colspan=\"" . (3 + $col_no) . "\" class=\"failed\" style=\"text-align:center\">&lt;unknown user&gt;</td>";
         }
     } else {
         $student_id = $student_id_array[$username];
         echo "<tr><td><img src=\"../artwork/green_plus_16.png\" wodth=\"16\" height=\"16\" alt=\"Add\" /></td><td>{$username}</td><td>" . $student_data[$student_id]['title'] . "</td><td>" . $student_data[$student_id]['surname'] . "</td><td>" . $student_data[$student_id]['first_names'] . "</td>";
         for ($i = 1; $i < $col_no; $i++) {
             $type = trim($heading[$i]);
             $value = trim($cols[$i]);
             echo "<td>{$value}</td>";
             if ($type != '') {
                 $stmt->execute();
             }
         }