Changeset 1324
- Timestamp:
- 01/21/08 13:54:26 (9 months ago)
- Files:
-
- trunk/wifidog-auth/CHANGELOG (modified) (1 diff)
- trunk/wifidog-auth/wifidog/classes/Node.php (modified) (5 diffs)
- trunk/wifidog-auth/wifidog/classes/Permission.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/wifidog-auth/CHANGELOG
r1323 r1324 1 1 # $Id$ 2 3 2008-01-16 Benoit Grégoire <bock@step.polymtl.ca> 4 * Fix #42 (Node cannot be renamed) 5 2 6 2008-01-16 Benoit Grégoire <bock@step.polymtl.ca> 3 7 * Temporary patch for problem introduced in [1319]: the menu did not display where main_area_top is empty (which is actually most places in the admin interface). This shouldn't have been done in the first place, as it doesn't fix the problem the menu cause of theming, and worse causes people to edit MainUI_Display.tpl, causing such errors. A network config option should have been provided to allow selecting in what area the menu goes. trunk/wifidog-auth/wifidog/classes/Node.php
r1322 r1324 1035 1035 $permArray[]=array(Permission::P('NODE_PERM_EDIT_CONFIG'), $this); 1036 1036 $permArray[]=array(Permission::P('NODE_PERM_EDIT_GATEWAY_ID'), $this); 1037 $permArray[]=array(Permission::P('NODE_PERM_EDIT_DEPLOYMENT_DATE'), $this); 1037 1038 Security::requireAnyPermission($permArray); 1038 1039 require_once('classes/InterfaceElements.php'); … … 1095 1096 1096 1097 // Name 1097 $_title = _("Name"); 1098 $_data = InterfaceElements::generateInputText("node_" . $node_id . "_name", $this->getName(), "node_name_input"); 1099 $_html_node_information[] = InterfaceElements::generateAdminSectionContainer("node_name", $_title, $_data); 1098 $permArray = null; 1099 $permArray[]=array(Permission::P('NETWORK_PERM_EDIT_ANY_NODE_CONFIG'), $network); 1100 $permArray[]=array(Permission::P('NODE_PERM_EDIT_NAME'), $this); 1101 if (Security::hasAnyPermission($permArray)) { 1102 $_title = _("Name"); 1103 $_data = InterfaceElements::generateInputText("node_" . $node_id . "_name", $this->getName(), "node_name_input"); 1104 $_html_node_information[] = InterfaceElements::generateAdminSectionContainer("node_name", $_title, $_data); 1105 } 1106 else { 1107 $_title = _("Name"); 1108 $_data = $this->getName(); 1109 $_html_node_information[] = InterfaceElements::generateAdminSectionContainer("node_name", $_title, $_data); 1110 } 1100 1111 1101 1112 // Creation date 1102 1113 $_title = _("Creation date"); 1103 if ($_userIsAdmin) { 1114 $permArray = null; 1115 $permArray[]=array(Permission::P('NETWORK_PERM_EDIT_ANY_NODE_CONFIG'), $network); 1116 $permArray[]=array(Permission::P('NODE_PERM_EDIT_DEPLOYMENT_DATE'), $this); 1117 if (Security::hasAnyPermission($permArray)) { 1104 1118 $_data = DateTimeWD::getSelectDateTimeUI(new DateTimeWD($this->getCreationDate()), "node_" . $node_id . "_creation_date", DateTimeWD::INTERFACE_DATETIME_FIELD, "node_creation_date_input"); 1105 1119 } else { … … 1264 1278 $permArray[]=array(Permission::P('NODE_PERM_EDIT_CONFIG'), $this); 1265 1279 $permArray[]=array(Permission::P('NODE_PERM_EDIT_GATEWAY_ID'), $this); 1280 $permArray[]=array(Permission::P('NODE_PERM_EDIT_DEPLOYMENT_DATE'), $this); 1266 1281 Security::requireAnyPermission($permArray); 1267 1282 // Check if user is a admin … … 1285 1300 1286 1301 // Name 1287 if ($_userIsAdmin) { 1302 $permArray = null; 1303 $permArray[]=array(Permission::P('NETWORK_PERM_EDIT_ANY_NODE_CONFIG'), $network); 1304 $permArray[]=array(Permission::P('NODE_PERM_EDIT_NAME'), $this); 1305 if (Security::hasAnyPermission($permArray)) { 1288 1306 $name = "node_".$node_id."_name"; 1289 1307 $this->setName($_REQUEST[$name]); 1290 } else {1291 $this->setName($this->getName());1292 1308 } 1293 1309 1294 1310 // Creation date 1295 if ($_userIsAdmin) { 1311 $permArray = null; 1312 $permArray[]=array(Permission::P('NETWORK_PERM_EDIT_ANY_NODE_CONFIG'), $network); 1313 $permArray[]=array(Permission::P('NODE_PERM_EDIT_DEPLOYMENT_DATE'), $this); 1314 if (Security::hasAnyPermission($permArray)) { 1296 1315 $name = "node_".$node_id."_creation_date"; 1297 1316 $this->setCreationDate(DateTimeWD::processSelectDateTimeUI($name, DateTimeWD :: INTERFACE_DATETIME_FIELD)->getIso8601FormattedString()); 1298 } else {1299 $this->setCreationDate($this->getCreationDate());1300 1317 } 1301 1318 … … 1623 1640 } 1624 1641 } 1625 if(Security::hasPermission(Permission::P('NETWORK_PERM_ADD_NODE'))){1642 if(Security::hasPermission(Permission::P('NETWORK_PERM_ADD_NODE'))){ 1626 1643 $items[] = array('path' => 'node/node_add_new', 1627 1644 'title' => sprintf(_("Add a new node")), trunk/wifidog-auth/wifidog/classes/Permission.php
r1322 r1324 100 100 101 101 $PERMISSIONS['NODE_PERM_EDIT_GATEWAY_ID'] = array(_("User is allowed to change the gateway id of this node"), StakeholderType::Node, false); 102 $PERMISSIONS['NODE_PERM_EDIT_NAME'] = array(_("User is allowed to change the public name of this node"), StakeholderType::Node, false); 103 $PERMISSIONS['NODE_PERM_EDIT_DEPLOYMENT_DATE'] = array(_("User is allowed to change the deployment date of this node"), StakeholderType::Node, false); 104 102 105 $PERMISSIONS['NODE_PERM_EDIT_CONFIG'] = array(_("TEMPORARY: User is allowed to edit general configuration for this node. This will be replaced with more granular permissions in the future"), StakeholderType::Node, false); 103 106
