예제 #1
0
 if (!$perms_error) {
     header("Location:error.php?ec=12");
     exit;
 }
 // Check to make sure the file is available
 $status = $filedata->getStatus($fileId);
 if ($status != 0) {
     header('Location:error.php?ec=2');
     exit;
 }
 // update category
 $filedata->setCategory($_REQUEST['category']);
 $filedata->setDescription($_REQUEST['description']);
 $filedata->setComment($_REQUEST['comment']);
 if (isset($_REQUEST['file_owner'])) {
     $filedata->setOwner($_REQUEST['file_owner']);
 }
 if (isset($_REQUEST['file_department'])) {
     $filedata->setDepartment($_REQUEST['file_department']);
 }
 // Update the file with the new values
 $filedata->updateData();
 udf_edit_file_update();
 // clean out old permissions
 $del_user_perms_query = "DELETE FROM {$GLOBALS['CONFIG']['db_prefix']}user_perms WHERE fid = :file_id";
 $del_user_perms_stmt = $pdo->prepare($del_user_perms_query);
 $del_user_perms_stmt->bindParam(':file_id', $fileId);
 $del_user_perms_stmt->execute();
 // clean out old permissions
 $del_dept_perms_query = "DELETE FROM {$GLOBALS['CONFIG']['db_prefix']}dept_perms WHERE fid = :file_id";
 $del_dept_perms_stmt = $pdo->prepare($del_dept_perms_query);
예제 #2
0
파일: edit.php 프로젝트: tejdeeps/tejcs.com
 if (!$perms_error) {
     header("Location:error.php?ec=12");
     exit;
 }
 // Check to make sure the file is available
 $status = $filedata->getStatus($fileId);
 if ($status != 0) {
     header('Location:error.php?ec=2');
     exit;
 }
 // update category
 $filedata->setCategory(mysql_real_escape_string($_REQUEST['category']));
 $filedata->setDescription(mysql_real_escape_string($_REQUEST['description']));
 $filedata->setComment(mysql_real_escape_string($_REQUEST['comment']));
 if (isset($_REQUEST['file_owner'])) {
     $filedata->setOwner(mysql_real_escape_string($_REQUEST['file_owner']));
 }
 if (isset($_REQUEST['file_department'])) {
     $filedata->setDepartment(mysql_real_escape_string($_REQUEST['file_department']));
 }
 // Update the file with the new values
 $filedata->updateData();
 udf_edit_file_update();
 // clean out old permissions
 $query = "DELETE FROM {$GLOBALS['CONFIG']['db_prefix']}user_perms WHERE fid = '{$fileId}'";
 $result = mysql_query($query, $GLOBALS['connection']) or die("Error in query: {$query}. " . mysql_error());
 $result_array = array();
 // init;
 foreach ($_REQUEST['user_permission'] as $user_id => $permission) {
     $query = "INSERT INTO {$GLOBALS['CONFIG']['db_prefix']}user_perms (fid, uid, rights) VALUES({$fileId}, {$user_id}, {$permission})";
     //echo $query."<br>";