![]() |
|---|
| [ Index ] |
Source Code Reference for V1.00 |
[Summary view] [Print] [Text view]
1 <?php /* $Id: do_resource_aed.php 40 2008-02-11 12:11:44Z pedroix $ $URL: https://web2project.svn.sourceforge.net/svnroot/web2project/trunk/modules/resources/do_resource_aed.php $ */ 2 if (!defined('W2P_BASE_DIR')) { 3 die('You should not access this file directly.'); 4 } 5 6 $del = w2PgetParam($_POST, 'del', 0); 7 $resource_id = intval(w2PgetParam($_POST, 'resource_id', 0)); 8 $isNotNew = $_POST['resource_id']; 9 $perms = &$AppUI->acl(); 10 if ($del) { 11 if (!$perms->checkModuleItem('resources', 'delete', $resource_id)) { 12 $AppUI->redirect('m=public&a=access_denied'); 13 } 14 } elseif ($isNotNew) { 15 if (!$perms->checkModuleItem('resources', 'edit', $resource_id)) { 16 $AppUI->redirect('m=public&a=access_denied'); 17 } 18 } else { 19 if (!$perms->checkModule('resources', 'add')) { 20 $AppUI->redirect('m=public&a=access_denied'); 21 } 22 } 23 24 $obj = &new CResource; 25 $msg = ''; 26 27 if (!$obj->bind($_POST)) { 28 $AppUI->setMsg($obj->getError(), UI_MSG_ERROR); 29 $AppUI->redirect(); 30 } 31 32 $AppUI->setMsg('Resource'); 33 if ($del) { 34 if (!$obj->canDelete($msg)) { 35 $AppUI->setMsg($msg, UI_MSG_ERROR); 36 $AppUI->redirect(); 37 } 38 if (($msg = $obj->delete())) { 39 $AppUI->setMsg($msg, UI_MSG_ERROR); 40 $AppUI->redirect(); 41 } else { 42 $AppUI->setMsg('deleted', UI_MSG_ALERT, true); 43 $AppUI->redirect('', -1); 44 } 45 } else { 46 if (($msg = $obj->store())) { 47 $AppUI->setMsg($msg, UI_MSG_ERROR); 48 } else { 49 $AppUI->setMsg($_POST['resource_id'] ? 'updated' : 'added', UI_MSG_OK, true); 50 } 51 $AppUI->redirect(); 52 } 53 ?>
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
| Generated: Thu Jan 8 03:00:03 2009 | Cross-referenced by PHPXref 0.7 |