home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 April / CMCD0404.ISO / Software / Freeware / Programare / dotproject / modules / admin / do_perms_aed.php < prev    next >
Encoding:
PHP Script  |  2003-05-08  |  714 b   |  29 lines

  1. <?php /* ADMIN $Id: do_perms_aed.php,v 1.3 2003/05/08 06:47:24 eddieajau Exp $ */
  2. $del = isset($_POST['del']) ? $_POST['del'] : 0;
  3.  
  4. $obj = new CPermission();
  5.  
  6. if (!$obj->bind( $_POST )) {
  7.     $AppUI->setMsg( $obj->getError(), UI_MSG_ERROR );
  8.     $AppUI->redirect();
  9. }
  10.  
  11. $AppUI->setMsg( 'Permission' );
  12. if ($del) {
  13.     if (($msg = $obj->delete())) {
  14.         $AppUI->setMsg( $msg, UI_MSG_ERROR );
  15.         $AppUI->redirect();
  16.     } else {
  17.         $AppUI->setMsg( "deleted", UI_MSG_ALERT, true );
  18.         $AppUI->redirect();
  19.     }
  20. } else {
  21.     $isNotNew = @$_POST['permission_id'];
  22.     if (($msg = $obj->store())) {
  23.         $AppUI->setMsg( $msg, UI_MSG_ERROR );
  24.     } else {
  25.         $AppUI->setMsg( $isNotNew ? 'updated' : 'added', UI_MSG_OK, true );
  26.     }
  27.     $AppUI->redirect();
  28. }
  29. ?>