home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 April / CMCD0404.ISO / Software / Freeware / Programare / dotproject / modules / system / roles / do_role_aed.php next >
Encoding:
PHP Script  |  2003-02-26  |  651 b   |  26 lines

  1. <?php /* ROLES $Id: do_role_aed.php,v 1.1 2003/02/26 01:24:30 eddieajau Exp $ */
  2. $del = isset($_POST['del']) ? $_POST['del'] : 0;
  3.  
  4. $role = new CRole();
  5.  
  6. if (($msg = $role->bind( $_POST ))) {
  7.     $AppUI->setMsg( $msg, UI_MSG_ERROR );
  8.     $AppUI->redirect();
  9. }
  10.  
  11. if ($del) {
  12.     if (($msg = $role->delete())) {
  13.         $AppUI->setMsg( $msg, UI_MSG_ERROR );
  14.     } else {
  15.         $AppUI->setMsg( "Role deleted", UI_MSG_ALERT );
  16.     }
  17. } else {
  18.     if (($msg = $role->store())) {
  19.         $AppUI->setMsg( $msg, UI_MSG_ERROR );
  20.     } else {
  21.         $isNotNew = @$_POST['role_id'];
  22.         $AppUI->setMsg( "Role ".($isNotNew ? 'updated' : 'inserted'), UI_MSG_OK );
  23.     }
  24. }
  25. $AppUI->redirect( "m=system&u=roles" );
  26. ?>