示例#1
0
$refererPage = "mainMenusPage_TABLE.php";
$SelfrefererPage = "guideFolder.php";
include "validateSession.php";
//validate session
//SET PERMISSIONS
$allowEditing = $loggedUser->checkIfAllowed("editInstructorsFolder");
//$allowViewAll = ""; NOT RELEVANT
if (!$loggedUser->checkIfAllowed("viewInstructorsFolder")) {
    $redirect = "Location:restricted2.html";
    echo header($redirect);
}
/////// END OF VALIDATIONS ///////////////
if ($allowEditing) {
    global $instructorsFolderDir;
    // The directory of the instructor aid folder
    $res = fileHandler($instructorsFolderDir, "instructorAid");
    //check if a file was uploaded
    if ($res && $res != 1) {
        // error in upload file
        echo "<font color=\"red\"><b>" . $res . "</b></font><br/>";
    }
}
function drawListLine($link, $displayname, $date, $type, $FID)
{
    ?>
		<li class="DOCUMENT_IMG_LIST">
		<?php 
    if (isset($_POST[finishEditing])) {
        unset($_POST[edit]);
    }
    if (isset($_POST[edit])) {
示例#2
0
             }
         } else {
             echo '<script>alert("There was an error.Retry.");window.location.assign("' . S_PATH . 'users.php");</script>';
             exit;
         }
     }
     break;
 case 'editUser':
     if ($_POST['uname'] != "" && $_POST['urefno'] != "" && $_POST['uemail'] != "" && $_POST['usf'] != "" && $_FILES['udp']['name'] != "" && ($_SESSION['topCode'] == 'EDC' || $_SESSION['topCode'] == 'EDT' || $_SESSION['topCode'] == 'DIR')) {
         $where['people_id'] = $_POST['uid'];
         $send['people_name'] = $_POST['uname'];
         $send['people_roll'] = $_POST['urefno'];
         $send['people_email'] = $_POST['uemail'];
         $send['people_sf'] = $_POST['usf'][0];
         // File Handling
         $link = fileHandler($_FILES['udp'], "img");
         if ($link != 'File Dimensions incorrect.' || $link != 'There was an error processing the file.' || $link != 'File Type Incorrect!') {
             $send['people_dp'] = 'img/profiles/' . $link;
             echo do_sql('people', $send, 'update', $mysqli, $where);
             header('Location:users.php?done=1');
         } else {
             echo $link;
         }
     } else {
         if ($_POST['uname'] != "" && $_POST['urefno'] != "" && $_POST['uemail'] != "" && ($_SESSION['topCode'] == 'EDC' || $_SESSION['topCode'] == 'EDT' || $_SESSION['topCode'] == 'DIR')) {
             $where['people_id'] = $_POST['uid'];
             $send['people_name'] = $_POST['uname'];
             $send['people_roll'] = $_POST['urefno'];
             $send['people_email'] = $_POST['uemail'];
             echo do_sql('people', $send, 'update', $mysqli, $where);
             header('Location:users.php?done=1');
	<style type="text/css">  
	    @import url(zivStyle.css);    
	</style>
	<script language="javascript" src="javascripts/javaScriptFunctions.js"></script>
	<head>
	</head>
	<body> 
		<?php 
if (!isset($_POST[groupID]) || !$_POST[groupID]) {
    $group = $loggedUser->getmemberOfGroup();
} else {
    $group = $_POST[groupID];
}
$userPictureFolder = $allUsresPictureFolder . $group . "/";
// folder to insert the new picture
$res = fileHandler($userPictureFolder, "newPicture", $loggedUser->getUname(), $group);
showPictures($group, $allowEditing, $allowViewAll, editSql($group));
echo "</form>";
if ($res && $res != 1) {
    // error in upload file
    echo "<font color=\"red\"><b>" . $res . "</b></font><br/>";
}
if ($group) {
    uploadNewPicture();
}
?>
	</body> 
</html> 

<?php 
/*******************************************************************************
示例#4
0
            $vs = $vs . '}';
            array_push($array, $vs);
        }
    }
    array_pop($array);
    return $array;
}
/**
 * 文件的读取,进行文件的处理
 * @param String $pregExp 需要读出的文件
 * @param String $pregExp 需要写入的文件
 * @return
 *
 */
function fileHandler($fielRead, $fileWiter, $posts)
{
    $baseCss = file_get_contents($fielRead);
    $formatCss = trimall(str_replace("'", '"', $baseCss));
    $pregExp = getPreg();
    $getArr = matchCss($pregExp, $formatCss, $posts);
    $ArrMerged = array_merge($getArr, array_diff(fileFmt($fileWiter), $getArr));
    $ArrMerged = str_replace("}", "}\n", $ArrMerged);
    print_r($ArrMerged);
    file_put_contents($fileWiter, $ArrMerged);
}
if (isset($_POST['postClass'])) {
    $posts = $_POST['postClass'];
    fileHandler('../css/rain.css', 'createdCss.txt', $posts);
} else {
    header('Location:./index.html');
}