示例#1
0
if ($authlib->validateToken($token) || $action == 'login' || $action == 'checksunbeam' || $override) {
    switch ($action) {
        // Put this at the top, because it needs to be the most responsive
        // Show the student image
        case 'showstudentimage':
            include 'lib/MediaLib.php';
            $medialib = new MediaLib();
            if ($_REQUEST['getbig'] == 'true') {
                $path = $medialib->displayRawStudentImage($_REQUEST['studentid']);
                //$fp = fopen($path, 'rb');
                header("Content-Type: image/png");
                header("Content-Length: " . filesize($path));
                readfile($path);
                die;
            } else {
                $thumb = $medialib->displayStudentThumb($_REQUEST['studentid'], $_REQUEST['getbig']);
                //   $path =
                //  header("HTTP/1.0 304 Not Modified");
                header('Content-type: image/jpeg');
                imagejpeg($thumb, NULL, 70);
                imagedestroy($thumb);
                die;
            }
            break;
            /////////////////////////////
            //Authentication management
            /////////////////////////////
        /////////////////////////////
        //Authentication management
        /////////////////////////////
        case 'login':