[ Index ]

Source Code Reference for V1.00

title

Body

[close]

/modules/files/ -> do_file_co.php (source)

   1  <?php /* $Id: do_file_co.php 135 2008-04-04 13:49:13Z pedroix $ $URL: https://web2project.svn.sourceforge.net/svnroot/web2project/trunk/modules/files/do_file_co.php $ */
   2  if (!defined('W2P_BASE_DIR')) {
   3      die('You should not access this file directly.');
   4  }
   5  
   6  //addfile sql
   7  $file_id = intval(w2PgetParam($_POST, 'file_id', 0));
   8  $coReason = w2PgetParam($_POST, 'file_co_reason', '');
   9  
  10  $perms = &$AppUI->acl();
  11  if (!$perms->checkModuleItem('files', 'edit', $file_id)) {
  12      $AppUI->redirect('m=public&a=access_denied');
  13  }
  14  
  15  $obj = new CFile();
  16  if ($file_id) {
  17      $obj->_message = 'updated';
  18      $oldObj = new CFile();
  19      $oldObj->load($file_id);
  20  
  21  } else {
  22      $obj->_message = 'added';
  23  }
  24  $obj->file_category = intval(w2PgetParam($_POST, 'file_category', 0));
  25  
  26  if (!$obj->bind($_POST)) {
  27      $AppUI->setMsg($obj->getError(), UI_MSG_ERROR);
  28      $AppUI->redirect();
  29  }
  30  
  31  if (!ini_get('safe_mode')) {
  32      set_time_limit(600);
  33  }
  34  ignore_user_abort(1);
  35  
  36  $obj->checkout($AppUI->user_id, $file_id, $coReason);
  37  
  38  // We now have to display the required page
  39  // Destroy the post stuff, and allow the page to display index.php again.
  40  $a = 'index';
  41  unset($_GET['a']);
  42  
  43  $params = 'file_id=' . $file_id;
  44  $session_id = SID;
  45  
  46  session_write_close();
  47  // are the params empty
  48  // Fix to handle cookieless sessions
  49  if ($session_id != '') {
  50      $params .= "&" . $session_id;
  51  }
  52  //        header( "Refresh: 0; URL=fileviewer.php?$params" );
  53  echo '<script type="text/javascript">
  54  fileloader = window.open("fileviewer.php?' . $params . '", "mywindow",
  55  "location=1,status=1,scrollbars=0,width=20,height=20");
  56  fileloader.moveTo(0,0);
  57  </script>';
  58  
  59  ?>


Generated: Wed Jan 7 03:00:01 2009 Cross-referenced by PHPXref 0.7