Esempio n. 1
0
 /**
  * Process admin interface of this object.
  *
  * @return void
  *
  * @access public
  */
 public function processAdminUI()
 {
     Security::requirePermission(Permission::P('NETWORK_PERM_EDIT_NETWORK_CONFIG'), $this);
     // Content management
     parent::processContentAdminUI();
     // name
     $name = "network_" . $this->getId() . "_name";
     $this->setName($_REQUEST[$name]);
     // creation_date
     $name = "network_" . $this->getId() . "_creation_date";
     $this->setCreationDate($_REQUEST[$name]);
     // homepage_url
     $name = "network_" . $this->getId() . "_homepage_url";
     $this->setWebSiteUrl($_REQUEST[$name]);
     // tech_support_email
     $name = "network_" . $this->getId() . "_tech_support_email";
     $this->setTechSupportEmail($_REQUEST[$name]);
     //  network_authenticator_class
     $name = "network_" . $this->getId() . "_network_authenticator_class";
     $this->setAuthenticatorClassName($_REQUEST[$name]);
     //  network_authenticator_params
     $name = "network_" . $this->getId() . "_network_authenticator_params";
     $this->setAuthenticatorConstructorParams($_REQUEST[$name]);
     //  is_default_network
     $name = "network_" . $this->getId() . "_is_default_network";
     if (!empty($_REQUEST[$name]) && $_REQUEST[$name] == 'on') {
         $this->setAsDefaultNetwork();
     }
     //  validation_grace_time
     $name = "network_" . $this->getId() . "_validation_grace_time";
     $this->setValidationGraceTime($_REQUEST[$name]);
     //  validation_email_from_address
     $name = "network_" . $this->getId() . "_validation_email_from_address";
     $this->setValidationEmailFromAddress($_REQUEST[$name]);
     $name = "network_" . $this->getId() . "_usernames_case_sensitive";
     $this->setUsernamesCaseSensitive(empty($_REQUEST[$name]) ? false : true);
     //  theme_pack
     $name = "network_" . $this->getId() . "_theme_pack";
     if (!empty($_REQUEST[$name])) {
         $theme_pack = ThemePack::getObject($_REQUEST[$name]);
     } else {
         $theme_pack = null;
     }
     $this->setThemePack($theme_pack);
     //  allow_multiple_login
     $name = "network_" . $this->getId() . "_allow_multiple_login";
     $this->setMultipleLoginAllowed(empty($_REQUEST[$name]) ? false : true);
     //  allow_splash_only_nodes
     $name = "network_" . $this->getId() . "_allow_splash_only_nodes";
     $this->setSplashOnlyNodesAllowed(empty($_REQUEST[$name]) ? false : true);
     //  allow_custom_portal_redirect
     $name = "network_" . $this->getId() . "_allow_custom_portal_redirect";
     $this->setCustomPortalRedirectAllowed(empty($_REQUEST[$name]) ? false : true);
     //  'allow_original_URL_redirect
     $name = "network_" . $this->getId() . "_allow_original_URL_redirect";
     $this->setPortalOriginalUrlAllowed(empty($_REQUEST[$name]) ? false : true);
     /*
      * Dynamic abuse control
      */
     $html_dynamic_abuse_control = array();
     $permArray = null;
     $permArray[] = array(Permission::P('NETWORK_PERM_EDIT_DYNAMIC_ABUSE_CONTROL'), $this);
     if (Security::hasAnyPermission($permArray)) {
         //  connection_limit_window
         $name = "network_" . $this->getId() . "_connection_limit_window";
         $this->setConnectionLimitWindow($_REQUEST[$name]);
         //  connection_limit_network_max_total_bytes
         $name = "network_" . $this->getId() . "_connection_limit_network_max_total_bytes";
         $this->setConnectionLimitNetworkMaxTotalBytes($_REQUEST[$name]);
         //  connection_limit_network_max_usage_duration
         $name = "network_" . $this->getId() . "_connection_limit_network_max_usage_duration";
         $this->setConnectionLimitNetworkMaxDuration($_REQUEST[$name]);
         //  connection_limit_node_max_total_bytes
         $name = "network_" . $this->getId() . "_connection_limit_node_max_total_bytes";
         $this->setConnectionLimitNodeMaxTotalBytes($_REQUEST[$name]);
         //  connection_limit_node_max_usage_duration
         $name = "network_" . $this->getId() . "_connection_limit_node_max_usage_duration";
         $this->setConnectionLimitNodeMaxDuration($_REQUEST[$name]);
     }
     // Access rights
     require_once 'classes/Stakeholder.php';
     Stakeholder::processAssignStakeholdersUI($this, $errMsg);
     if (!empty($errMsg)) {
         echo $errMsg;
     }
     // GIS data
     if (defined('GMAPS_HOTSPOTS_MAP_ENABLED') && GMAPS_HOTSPOTS_MAP_ENABLED == true) {
         $gis_lat_name = "network_" . $this->getId() . "_gis_latitude";
         $gis_long_name = "network_" . $this->getId() . "_gis_longitude";
         $gis_alt_name = "network_" . $this->getId() . "_gis_altitude";
         $this->setGisLocation(new GisPoint($_REQUEST[$gis_lat_name], $_REQUEST[$gis_long_name], $_REQUEST[$gis_alt_name]));
         $name = "network_" . $this->getId() . "_gmaps_map_type";
         $this->setGisMapType($_REQUEST[$name]);
     }
     // Profile templates
     $name = "network_" . $this->_id . "_profile_templates";
     ProfileTemplate::processLinkedProfileTemplateUI($name, 'network_has_profile_templates', 'network_id', $this->_id);
     parent::processGraphAdminUI($errMsg, $this);
     if (!empty($errMsg)) {
         echo $errMsg;
         $errMsg = null;
     }
     // Node creation
     $new_node = Node::processCreateNewObjectUI();
     if ($new_node) {
         $url = GENERIC_OBJECT_ADMIN_ABS_HREF . "?" . http_build_query(array("object_class" => "Node", "action" => "edit", "object_id" => $new_node->getId()));
         header("Location: {$url}");
     }
 }