[ Index ]

Source Code Reference for V1.00

title

Body

[close]

/modules/forums/ -> do_forum_aed.php (source)

   1  <?php /* $Id: do_forum_aed.php 102 2008-03-18 19:52:59Z pedroix $ $URL: https://web2project.svn.sourceforge.net/svnroot/web2project/trunk/modules/forums/do_forum_aed.php $ */
   2  if (!defined('W2P_BASE_DIR')) {
   3      die('You should not access this file directly.');
   4  }
   5  
   6  $del = isset($_POST['del']) ? $_POST['del'] : 0;
   7  
   8  $isNotNew = $_POST['forum_id'];
   9  $perms = &$AppUI->acl();
  10  if ($del) {
  11      if (!$perms->checkModule('forums', 'delete')) {
  12          $AppUI->redirect('m=public&a=access_denied');
  13      }
  14  } elseif ($isNotNew) {
  15      if (!$perms->checkModule('forums', 'edit')) {
  16          $AppUI->redirect('m=public&a=access_denied');
  17      }
  18  } else {
  19      if (!$perms->checkModule('forums', 'add')) {
  20          $AppUI->redirect('m=public&a=access_denied');
  21      }
  22  }
  23  
  24  $obj = new CForum();
  25  
  26  if (($msg = $obj->bind($_POST))) {
  27      $AppUI->setMsg($msg, UI_MSG_ERROR);
  28      $AppUI->redirect();
  29  }
  30  
  31  // prepare (and translate) the module name ready for the suffix
  32  $AppUI->setMsg('Forum');
  33  if ($del) {
  34      if (($msg = $obj->delete())) {
  35          $AppUI->setMsg($msg, UI_MSG_ERROR);
  36          $AppUI->redirect();
  37      } else {
  38          $AppUI->setMsg('deleted', UI_MSG_ALERT, true);
  39          $AppUI->redirect('m=forums');
  40      }
  41  } else {
  42      if (($msg = $obj->store())) {
  43          $AppUI->setMsg($msg, UI_MSG_ERROR);
  44      } else {
  45          $AppUI->setMsg($isNotNew ? 'updated' : 'added', UI_MSG_OK, true);
  46      }
  47      $AppUI->redirect();
  48  }
  49  ?>


Generated: Fri Jan 9 03:00:02 2009 Cross-referenced by PHPXref 0.7