protected function processValid() { //Load class variable realmToEdit if (isset($this->fieldData['realmToEdit'])) { $this->realmToEdit = $this->fieldData['realmToEdit']; //The is_numeric call protects against sql injection on this variable if (!is_numeric($this->fieldData['realmToEdit'])) { $badrid = $this->fieldData['realmToEdit']; throw new LoggedException("An invalid realm id was passed ({$badrid})", 0, self::module, 'error'); } } if ($this->formName == 'addRealmDetailsForm' || $this->formName == 'modifyRealmDetailsForm') { //Save the details if the detailsForm is submitted if (!isset($this->fieldData['realmToEdit']) || $this->fieldData['realmToEdit'] == "") { AuthUtil::addRealm($this->fieldData['parentID'], $this->fieldData['name'], $this->fieldData); $this->fieldData['newRealmID'] = $this->realmToEdit; } else { AuthUtil::modifyRealm($this->realmToEdit, $this->fieldData); } } elseif ($this->formName == 'realmDeleteForm') { AuthUtil::deleteRealm($this->fieldData['realmToEdit']); } }
/** * * * @param array $realmPath The path to the parent realm * @param string $newRealmName The name for the new realm name * @return boolean True on success, false on failure */ public static function addRealm($realmPath, $newRealmName) { return AuthUtil::addRealm($realmPath, $newRealmName, array()); }