@@ -177,7 +177,7 @@
error = mysqli_error($this->db)) {
- throw new Exception("There was a problem with the database: " . $this->error);
+ throw new Exception(_("There was a problem with the database: ") . $this->error);
}
}
@@ -48,6 +48,7 @@ protected function connect() {
$databaseName = $this->config->database->name;
$this->db = mysqli_connect($host, $username, $password, $databaseName);
$this->checkForError();
+ mysqli_set_charset($this->db, 'utf8');
}
protected function disconnect() {
diff --git a/admin/classes/common/Object.php b/admin/classes/common/Object.php
index 3ebdbf8..948b3bb 100644
--- a/admin/classes/common/Object.php
+++ b/admin/classes/common/Object.php
@@ -1,89 +1,89 @@
-.
-**
-**************************************************************************************************************************
-*/
-
-
-class Object {
-
- public function __construct(NamedArguments $arguments = NULL) {
- if (method_exists($this, 'init')) {
- if (!is_a($arguments, 'NamedArguments')) {
- $arguments = new NamedArguments(array());
- }
- $this->init($arguments);
- }
- }
-
- // An optional initializer to use instead of |__construct()|.
- protected function init(NamedArguments $arguments) {
-
- }
-
- public function __destruct() {
- if (method_exists($this, 'dealloc')) {
- $this->dealloc();
- }
- }
-
- // An optional method called on deconstruction instead of |__deconstruct()|.
- protected function dealloc() {
-
- }
-
- // Setters are functions called |$instance->setPropertyName($value)|.
- public function __set($name, $value) {
- $methodName = 'set' . ucfirst($name);
- $this->$methodName($value);
- }
-
- // Getters are functions called |$instance->propertyName()|.
- public function __get($name) {
- return $this->$name();
- }
-
- // Default setter uses declared properties.
- protected function setValueForKey($key, $value) {
- if (property_exists($this, $key)) {
- $this->$key = $value;
- } else {
- throw new Exception("Cannot set value for undefined key ($key).");
- }
- }
-
- // Default getter uses declared properties.
- protected function valueForKey($key) {
- if (property_exists($this, $key)) {
- return $this->$key;
- } else {
- throw new Exception("Cannot get value for undefined key ($key).");
- }
- }
-
- // Call |valueForKey| and |setValueForKey| as default setter and getter.
- public function __call($name, $arguments) {
- if (preg_match('/^set[A-Z]/', $name)) {
- $key = preg_replace('/^set/', '\1', $name);
- $key = lcfirst($key);
- $this->setValueForKey($key, $arguments[0]);
- } else {
- return $this->valueForKey($name);
- }
- }
-
-}
-
+.
+**
+**************************************************************************************************************************
+*/
+
+
+class Object {
+
+ public function __construct(NamedArguments $arguments = NULL) {
+ if (method_exists($this, 'init')) {
+ if (!is_a($arguments, 'NamedArguments')) {
+ $arguments = new NamedArguments(array());
+ }
+ $this->init($arguments);
+ }
+ }
+
+ // An optional initializer to use instead of |__construct()|.
+ protected function init(NamedArguments $arguments) {
+
+ }
+
+ public function __destruct() {
+ if (method_exists($this, 'dealloc')) {
+ $this->dealloc();
+ }
+ }
+
+ // An optional method called on deconstruction instead of |__deconstruct()|.
+ protected function dealloc() {
+
+ }
+
+ // Setters are functions called |$instance->setPropertyName($value)|.
+ public function __set($name, $value) {
+ $methodName = 'set' . ucfirst($name);
+ $this->$methodName($value);
+ }
+
+ // Getters are functions called |$instance->propertyName()|.
+ public function __get($name) {
+ return $this->$name();
+ }
+
+ // Default setter uses declared properties.
+ protected function setValueForKey($key, $value) {
+ if (property_exists($this, $key)) {
+ $this->$key = $value;
+ } else {
+ throw new Exception("Cannot set value for undefined key ($key).");
+ }
+ }
+
+ // Default getter uses declared properties.
+ protected function valueForKey($key) {
+ if (property_exists($this, $key)) {
+ return $this->$key;
+ } else {
+ throw new Exception(_("Cannot get value for undefined key (").$key.").");
+ }
+ }
+
+ // Call |valueForKey| and |setValueForKey| as default setter and getter.
+ public function __call($name, $arguments) {
+ if (preg_match('/^set[A-Z]/', $name)) {
+ $key = preg_replace('/^set/', '\1', $name);
+ $key = lcfirst($key);
+ $this->setValueForKey($key, $arguments[0]);
+ } else {
+ return $this->valueForKey($name);
+ }
+ }
+
+}
+
?>
\ No newline at end of file
diff --git a/admin/classes/common/Utility.php b/admin/classes/common/Utility.php
index 16cf994..3514ea7 100644
--- a/admin/classes/common/Utility.php
+++ b/admin/classes/common/Utility.php
@@ -84,6 +84,10 @@ public function getOrganizationURL(){
return $this->getCORALURL() . "organizations/orgDetail.php?organizationID=";
}
+ public function getResourceURL(){
+ return $this->getCORALURL() . "resources/resource.php?resourceID=";
+ }
+
@@ -100,10 +104,12 @@ public function fixLicenseFormEnter($editLicenseID){
if ($result['max_licenseID']){
header('Location: license.php?licenseID=' . $result['max_licenseID']);
+ exit; //PREVENT SECURITY HOLE
}
}else{
header('Location: license.php?licenseID=' . $editLicenseID);
+ exit; //PREVENT SECURITY HOLE
}
}
diff --git a/admin/classes/domain/License.php b/admin/classes/domain/License.php
index 2d188b4..c688c5f 100644
--- a/admin/classes/domain/License.php
+++ b/admin/classes/domain/License.php
@@ -1,682 +1,711 @@
-.
-**
-**************************************************************************************************************************
-*/
-
-
-class License extends DatabaseObject {
-
- protected function defineRelationships() {}
-
- protected function overridePrimaryKeyName() {}
-
-
-
- //returns array of Document objects - used by forms to get dropdowns of available documents
- public function getDocuments(){
-
- $query = "SELECT D.*
- FROM Document D
- LEFT JOIN Signature S ON (S.documentID = D.documentID)
- LEFT JOIN DocumentType DT ON (DT.documentTypeID = D.documentTypeID)
- WHERE licenseID = '" . $this->licenseID . "'
- AND (D.expirationDate is null OR D.expirationDate = '0000-00-00')
- GROUP BY D.documentID
- ORDER BY D.shortName;";
-
- $result = $this->db->processQuery($query, 'assoc');
-
- $objects = array();
-
- //need to do this since it could be that there's only one request and this is how the dbservice returns result
- if (isset($result['documentID'])){
- $object = new Document(new NamedArguments(array('primaryKey' => $result['documentID'])));
- array_push($objects, $object);
- }else{
- foreach ($result as $row) {
- $object = new Document(new NamedArguments(array('primaryKey' => $row['documentID'])));
- array_push($objects, $object);
- }
- }
-
- return $objects;
- }
-
-
- //returns array of Document objects (parent documents) - used for document display on license record
- public function getDocumentsWithoutParents($orderBy){
-
- $query = "SELECT D.*
- FROM Document D
- LEFT JOIN Signature S ON (S.documentID = D.documentID)
- LEFT JOIN DocumentType DT ON (DT.documentTypeID = D.documentTypeID)
- WHERE licenseID = '" . $this->licenseID . "'
- AND (D.expirationDate is null OR D.expirationDate = '0000-00-00')
- AND (D.parentDocumentID is null OR D.parentDocumentID=0)
- GROUP BY D.documentID
- ORDER BY " . $orderBy . ";";
-
- $result = $this->db->processQuery($query, 'assoc');
-
- $objects = array();
-
- //need to do this since it could be that there's only one request and this is how the dbservice returns result
- if (isset($result['documentID'])){
- $object = new Document(new NamedArguments(array('primaryKey' => $result['documentID'])));
- array_push($objects, $object);
- }else{
- foreach ($result as $row) {
- $object = new Document(new NamedArguments(array('primaryKey' => $row['documentID'])));
- array_push($objects, $object);
- }
- }
-
- return $objects;
- }
-
-
-
- //returns array of Document objects that are archived - used by forms to get dropdowns of available documents
- public function getArchivedDocuments(){
-
- $query = "SELECT D.* FROM Document D
- LEFT JOIN Signature S ON (S.documentID = D.documentID)
- LEFT JOIN DocumentType DT ON (DT.documentTypeID = D.documentTypeID)
- WHERE D.documentTypeID = DT.documentTypeID
- AND licenseID = '" . $this->licenseID . "'
- AND (D.expirationDate is not null AND D.expirationDate != '0000-00-00')
- GROUP BY D.documentID
- ORDER BY D.shortName asc;";
-
- $result = $this->db->processQuery($query, 'assoc');
-
- $objects = array();
-
- //need to do this since it could be that there's only one request and this is how the dbservice returns result
- if (isset($result['documentID'])){
- $object = new Document(new NamedArguments(array('primaryKey' => $result['documentID'])));
- array_push($objects, $object);
- }else{
- foreach ($result as $row) {
- $object = new Document(new NamedArguments(array('primaryKey' => $row['documentID'])));
- array_push($objects, $object);
- }
- }
-
- return $objects;
- }
-
- //returns array of Document objects that are archived - used by document display on license record
- public function getArchivedDocumentsWithoutParents($orderBy){
-
- $query = "SELECT D.* FROM Document D
- LEFT JOIN Signature S ON (S.documentID = D.documentID)
- LEFT JOIN DocumentType DT ON (DT.documentTypeID = D.documentTypeID)
- WHERE D.documentTypeID = DT.documentTypeID
- AND licenseID = '" . $this->licenseID . "'
- AND (D.expirationDate is not null AND D.expirationDate != '0000-00-00')
- AND (D.parentDocumentID is null OR D.parentDocumentID=0)
- GROUP BY D.documentID
- ORDER BY " . $orderBy . ";";
-
- $result = $this->db->processQuery($query, 'assoc');
-
- $objects = array();
-
- //need to do this since it could be that there's only one request and this is how the dbservice returns result
- if (isset($result['documentID'])){
- $object = new Document(new NamedArguments(array('primaryKey' => $result['documentID'])));
- array_push($objects, $object);
- }else{
- foreach ($result as $row) {
- $object = new Document(new NamedArguments(array('primaryKey' => $row['documentID'])));
- array_push($objects, $object);
- }
- }
-
- return $objects;
- }
-
-
-
-
-
- //returns array of Attachment objects
- public function getAttachments(){
-
- $query = "SELECT * FROM Attachment where licenseID = '" . $this->licenseID . "' ORDER BY attachmentID";
-
- $result = $this->db->processQuery($query, 'assoc');
-
- $objects = array();
-
- //need to do this since it could be that there's only one request and this is how the dbservice returns result
- if (isset($result['attachmentID'])){
- $object = new Attachment(new NamedArguments(array('primaryKey' => $result['attachmentID'])));
- array_push($objects, $object);
- }else{
- foreach ($result as $row) {
- $object = new Attachment(new NamedArguments(array('primaryKey' => $row['attachmentID'])));
- array_push($objects, $object);
- }
- }
-
- return $objects;
- }
-
-
-
-
- //removes this license
- public function removeLicense(){
-
- //delete all documents and associated expressions and SFX providers
- $document = new Document();
- foreach ($this->getDocuments() as $document) {
- //delete all expressions and expression notes
- $expression = new Expression();
- foreach ($document->getExpressions() as $expression) {
- $expressionNote = new ExpressionNote();
- foreach ($expression->getExpressionNotes() as $expressionNote) {
- $expressionNote->delete();
- }
-
- $expression->removeQualifiers();
- $expression->delete();
- }
-
- $sfxProvider = new SFXProvider();
- foreach ($document->getSFXProviders() as $sfxProvider) {
- $sfxProvider->delete();
- }
-
- $signature = new Signature();
- foreach ($document->getSignatures() as $signature) {
- $signature->delete();
- }
-
- $document->delete();
- }
-
-
- //delete all attachments
- $attachment = new Attachment();
- foreach ($this->getAttachments() as $attachment) {
- $attachmentFile = new AttachmentFile();
- foreach ($attachment->getAttachmentFiles() as $attachmentFile) {
- $attachmentFile->delete();
- }
- $attachment->delete();
- }
-
-
- $this->delete();
- }
-
- public function searchQuery($whereAdd, $orderBy = '', $limit = '', $count = false) {
- if (count($whereAdd) > 0){
- $whereStatement = " AND " . implode(" AND ", $whereAdd);
- }else{
- $whereStatement = "";
- }
-
- if ($limit != ""){
- $limitStatement = " LIMIT " . $limit;
- }else{
- $limitStatement = "";
- }
-
- $config = new Configuration;
-
- //if the org module is installed get the org name from org database
- if ($config->settings->organizationsModule == 'Y') {
- $dbName = $config->settings->organizationsDatabaseName;
- if ($count) {
- $select = "SELECT COUNT(DISTINCT L.licenseID) count";
- } else {
- $select = "SELECT distinct L.licenseID, L.shortName licenseName, O2.name consortiumName, O.name providerName, S.shortName status";
- }
- //now formulate query
- $query = $select . "
- FROM " . $dbName . ".Organization O, License L
- LEFT JOIN " . $dbName . ".Organization O2 ON (O2.organizationID = L.consortiumID)
- LEFT JOIN " . $dbName . ".Alias A ON (A.organizationID = L.organizationID)
- LEFT JOIN Status S ON (S.statusID = L.statusID)
- LEFT JOIN Document D ON (D.licenseID = L.licenseID)
- LEFT JOIN Expression E ON (D.documentID = E.documentID)
- WHERE O.organizationID = L.organizationID
- " . $whereStatement;
-
- } else {
- if ($count) {
- $select = "SELECT COUNT(DISTINCT L.licenseID) count";
- } else {
- $select = "SELECT distinct L.licenseID, L.shortName licenseName, C.shortName consortiumName, O.shortName providerName, S.shortName status";
- }
- //now formulate query
- $query = $select . "
- FROM Organization O, License L
- LEFT JOIN Consortium C ON (C.consortiumID = L.consortiumID)
- LEFT JOIN Status S ON (S.statusID = L.statusID)
- LEFT JOIN Document D ON (D.licenseID = L.licenseID)
- LEFT JOIN Expression E ON (D.documentID = E.documentID)
- WHERE O.organizationID = L.organizationID
- " . $whereStatement;
-
- }
-
- if ($orderBy) {
- $query .= "\nORDER BY " . $orderBy;
- }
-
- if ($limit) {
- $query .= "\nLIMIT " . $limit;
- }
-
- return $query;
- }
-
- public function searchCount($whereAdd) {
- $query = $this->searchQuery($whereAdd, '', '', true);
- $result = $this->db->processQuery(stripslashes($query), 'assoc');
- return $result['count'];
- }
-
- //returns array based on search
- public function search($whereAdd, $orderBy, $limit){
- $query = $this->searchQuery($whereAdd, $orderBy, $limit);
-
- $result = $this->db->processQuery(stripslashes($query), 'assoc');
-
-
- $searchArray = array();
- $resultArray = array();
-
- //need to do this since it could be that there's only one result and this is how the dbservice returns result
- if (isset($result['licenseID'])){
-
- foreach (array_keys($result) as $attributeName) {
- $resultArray[$attributeName] = $result[$attributeName];
- }
-
- array_push($searchArray, $resultArray);
- }else{
- foreach ($result as $row) {
- $resultArray = array();
- foreach (array_keys($row) as $attributeName) {
- $resultArray[$attributeName] = $row[$attributeName];
- }
- array_push($searchArray, $resultArray);
- }
- }
-
- return $searchArray;
-
-
- }
-
-
-
-
-
-
- //returns array
- public function getInProgressLicenses(){
- $config = new Configuration;
-
- //if the org module is installed get the org name from org database
- if ($config->settings->organizationsModule == 'Y'){
- $dbName = $config->settings->organizationsDatabaseName;
-
- //execute query to get default licenses
- $query = "SELECT L.licenseID, L.shortName licenseName, O2.name consortiumName, O.name providerName, S.shortName status
- FROM " . $dbName . ".Organization O, License L
- LEFT JOIN " . $dbName . ".Organization O2 ON (O2.organizationID = L.consortiumID)
- LEFT JOIN Status S ON (S.statusID = L.statusID)
- WHERE O.organizationID = L.organizationID
- AND (S.shortName in ('Editing Expressions','Awaiting Document') OR L.statusID IS NULL)
- ORDER BY L.shortName";
- }else{
-
- //execute query to get default licenses
- $query = "SELECT L.licenseID, L.shortName licenseName, C.shortName consortiumName, O.shortName providerName, S.shortName status
- FROM Organization O, License L
- LEFT JOIN Consortium C ON (C.consortiumID = L.consortiumID)
- LEFT JOIN Status S ON (S.statusID = L.statusID)
- WHERE O.organizationID = L.organizationID
- AND (S.shortName in ('Editing Expressions','Awaiting Document') OR L.statusID IS NULL)
- ORDER BY L.shortName";
-
- }
-
- $result = $this->db->processQuery($query, 'assoc');
-
- $searchArray = array();
- $resultArray = array();
-
- //need to do this since it could be that there's only one result and this is how the dbservice returns result
- if (isset($result['licenseID'])){
-
- foreach (array_keys($result) as $attributeName) {
- $resultArray[$attributeName] = $result[$attributeName];
- }
-
- array_push($searchArray, $resultArray);
- }else{
- foreach ($result as $row) {
- $resultArray = array();
- foreach (array_keys($row) as $attributeName) {
- $resultArray[$attributeName] = $row[$attributeName];
- }
- array_push($searchArray, $resultArray);
- }
- }
-
- return $searchArray;
- }
-
-
-
- //returns array of Expressions
- public function getAllDocumentsForExpressionDisplay(){
-
- $query="SELECT distinct D.documentID, D.shortName documentName
- FROM Document D, Expression E
- WHERE E.documentID = D.documentID
- AND licenseID = '" . $this->licenseID . "' AND (D.expirationDate is null or D.expirationDate ='0000-00-00')
- ORDER BY documentID;";
-
- $result = $this->db->processQuery($query, 'assoc');
-
- $objects = array();
-
- //need to do this since it could be that there's only one request and this is how the dbservice returns result
- if (isset($result['documentID'])){
- $object = new Document(new NamedArguments(array('primaryKey' => $result['documentID'])));
- array_push($objects, $object);
- }else{
- foreach ($result as $row) {
- $object = new Document(new NamedArguments(array('primaryKey' => $row['documentID'])));
- array_push($objects, $object);
- }
- }
-
- return $objects;
- }
-
-
- //search used for the autocomplete
- public function searchOrganizations($q){
- $config = new Configuration;
-
- $q = str_replace("+", " ",$q);
- $q = str_replace("%", "&",$q);
-
- $orgArray = array();
-
- //if the org module is installed get the org names from org database
- if ($config->settings->organizationsModule == 'Y'){
-
- $dbName = $config->settings->organizationsDatabaseName;
-
-
- $query = "SELECT CONCAT(A.name, ' (', O.name, ')') name, O.organizationID
- FROM " . $dbName . ".Alias A, " . $dbName . ".Organization O
- WHERE A.organizationID=O.organizationID
- AND upper(A.name) like upper('%" . $q . "%')
- UNION
- SELECT name, organizationID
- FROM " . $dbName . ".Organization
- WHERE upper(name) like upper('%" . $q . "%')
- ORDER BY 1;";
-
- $result = mysqli_query($this->db->getDatabase(), $query);
-
- while ($row = mysqli_fetch_assoc($result)){
- $orgArray[] = $row['organizationID'] . "|" . $row['name'];
- }
-
-
- //otherwise get the orgs from this database
- }else{
- $query = "SELECT shortName, organizationID
- FROM Organization
- WHERE upper(shortName) like upper('%" . $q . "%')
- ORDER BY 1;";
-
- $result = mysqli_query($this->db->getDatabase(), $query);
-
- while ($row = mysqli_fetch_assoc($result)){
- $orgArray[] = $row['organizationID'] . "|" . $row['shortName'];
- }
-
-
- }
-
-
- return $orgArray;
- }
-
-
-
-
- //search used index page drop down
- public function getOrganizationList(){
- $config = new Configuration;
-
- $orgArray = array();
-
- //if the org module is installed get the org names from org database
- if ($config->settings->organizationsModule == 'Y'){
- $dbName = $config->settings->organizationsDatabaseName;
- $query = "SELECT name, organizationID FROM " . $dbName . ".Organization ORDER BY 1;";
-
- //otherwise get the orgs from this database
- }else{
- $query = "SELECT shortName name, organizationID FROM Organization ORDER BY 1;";
- }
-
-
- $result = $this->db->processQuery($query, 'assoc');
-
- $resultArray = array();
-
- //need to do this since it could be that there's only one result and this is how the dbservice returns result
- if (isset($result['organizationID'])){
-
- foreach (array_keys($result) as $attributeName) {
- $resultArray[$attributeName] = $result[$attributeName];
- }
-
- array_push($orgArray, $resultArray);
- }else{
- foreach ($result as $row) {
- $resultArray = array();
- foreach (array_keys($row) as $attributeName) {
- $resultArray[$attributeName] = $row[$attributeName];
- }
- array_push($orgArray, $resultArray);
- }
- }
-
- return $orgArray;
-
- }
-
-
-
- //go to organizations and get the org name for this license
- public function getOrganizationName(){
- $config = new Configuration;
-
- //if the org module is installed get the org name from org database
- if ($config->settings->organizationsModule == 'Y'){
- $dbName = $config->settings->organizationsDatabaseName;
-
- $orgArray = array();
- $query = "SELECT name FROM " . $dbName . ".Organization WHERE organizationID = " . $this->organizationID;
-
- if ($result = mysqli_query($this->db->getDatabase(), $query)){
-
- while ($row = mysqli_fetch_assoc($result)){
- return $row['name'];
- }
- }
- //otherwise if the org module is not installed get the org name from this database
- }else{
- $organization = new Organization(new NamedArguments(array('primaryKey' => $this->organizationID)));
- return $organization->shortName;
- }
- }
-
-
-
- //insert the organization / provider if it doesn't already exist
- public function setOrganization($orgID, $orgName){
- $config = new Configuration;
-
- //if the org module is installed get the org name from org database
- if ($config->settings->organizationsModule == 'Y'){
- //if no org ID was passed in then we need to create a new organization shell
- if (!$orgID){
-
- $dbName = $config->settings->organizationsDatabaseName;
- $orgName = str_replace("'", "''",$orgName);
-
- $query = "INSERT INTO " . $dbName . ".Organization (name, createDate, createLoginID) VALUES ('" . $orgName . "', NOW(), '" . $_SESSION['loginID'] . "')";
-
- $this->organizationID = $this->db->processQuery($query);
-
- }else{
- $this->organizationID = $orgID;
- }
-
- //otherwise if the org module is not installed get the org name from this database
- }else{
-
- //if no org ID was passed in then we need to create a new provider
- if (!$orgID){
- $organization = new Organization();
- $organization->organizationID = '';
- $organization->shortName = $orgName;
- $organization->save();
-
- $this->organizationID = $organization->primaryKey;
- }else{
- $this->organizationID = $orgID;
- }
- }
- }
-
-
-
-
-
- //search used index page drop down
- public function getConsortiumList(){
- $config = new Configuration;
-
- $consortiumArray = array();
-
- //if the org module is installed get the consortia names from org database
- if ($config->settings->organizationsModule == 'Y'){
- $dbName = $config->settings->organizationsDatabaseName;
- $query = "SELECT name, O.organizationID consortiumID
- FROM " . $dbName . ".Organization O,
- " . $dbName . ".OrganizationRoleProfile ORP,
- " . $dbName . ".OrganizationRole
- WHERE OrganizationRole.organizationRoleID = ORP.organizationRoleID
- AND ORP.organizationID = O.organizationID
- AND UPPER(OrganizationRole.shortName) LIKE 'CONSORT%'
- ORDER BY 1;";
-
- //otherwise get the consortium from this database
- }else{
- $query = "SELECT shortName name, consortiumID FROM Consortium ORDER BY 1;";
- }
-
-
- $result = $this->db->processQuery($query, 'assoc');
-
- $resultArray = array();
-
- //need to do this since it could be that there's only one result and this is how the dbservice returns result
- if (isset($result['consortiumID'])){
-
- foreach (array_keys($result) as $attributeName) {
- $resultArray[$attributeName] = $result[$attributeName];
- }
-
- array_push($consortiumArray, $resultArray);
- }else{
- foreach ($result as $row) {
- $resultArray = array();
- foreach (array_keys($row) as $attributeName) {
- $resultArray[$attributeName] = $row[$attributeName];
- }
- array_push($consortiumArray, $resultArray);
- }
- }
-
- return $consortiumArray;
-
- }
-
-
-
- //go to organizations and get the consortia name for this license
- public function getConsortiumName(){
- $config = new Configuration;
-
- //if the org module is installed get the org name from org database
- if ($config->settings->organizationsModule == 'Y'){
- $dbName = $config->settings->organizationsDatabaseName;
-
- $orgArray = array();
- $query = "SELECT name FROM " . $dbName . ".Organization WHERE organizationID = " . $this->consortiumID;
- $result = mysqli_query($this->db->getDatabase(), $query);
-
- while ($row = mysqli_fetch_assoc($result)){
- return $row['name'];
- }
- //otherwise if the org module is not installed get the consortium name from this database
- }else{
- $consortium = new Consortium(new NamedArguments(array('primaryKey' => $this->consortiumID)));
- return $consortium->shortName;
- }
- }
-
-
-
- //used for A-Z on search (index)
- public function getAlphabeticalList(){
- $alphArray = array();
- $result = mysqli_query($this->db->getDatabase(), "SELECT DISTINCT UPPER(SUBSTR(TRIM(LEADING 'The ' FROM shortName),1,1)) letter, COUNT(SUBSTR(TRIM(LEADING 'The ' FROM shortName),1,1)) letter_count
- FROM License L
- GROUP BY SUBSTR(TRIM(LEADING 'The ' FROM shortName),1,1)
- ORDER BY 1;");
-
- while ($row = mysqli_fetch_assoc($result)){
- $alphArray[$row['letter']] = $row['letter_count'];
- }
-
- return $alphArray;
- }
-
-
-}
-
-?>
+.
+**
+**************************************************************************************************************************
+*/
+
+
+class License extends DatabaseObject {
+
+ protected function defineRelationships() {}
+
+ protected function overridePrimaryKeyName() {}
+
+
+
+ //returns array of Document objects - used by forms to get dropdowns of available documents
+ public function getDocuments(){
+
+ $query = "SELECT D.*
+ FROM Document D
+ LEFT JOIN Signature S ON (S.documentID = D.documentID)
+ LEFT JOIN DocumentType DT ON (DT.documentTypeID = D.documentTypeID)
+ WHERE licenseID = '" . $this->licenseID . "'
+ AND (D.expirationDate is null OR D.expirationDate = '0000-00-00')
+ GROUP BY D.documentID
+ ORDER BY D.shortName;";
+
+ $result = $this->db->processQuery($query, 'assoc');
+
+ $objects = array();
+
+ //need to do this since it could be that there's only one request and this is how the dbservice returns result
+ if (isset($result['documentID'])){
+ $object = new Document(new NamedArguments(array('primaryKey' => $result['documentID'])));
+ array_push($objects, $object);
+ }else{
+ foreach ($result as $row) {
+ $object = new Document(new NamedArguments(array('primaryKey' => $row['documentID'])));
+ array_push($objects, $object);
+ }
+ }
+
+ return $objects;
+ }
+
+ //returns array of Resource object - used for helpful links display on license record
+ public function getResourceArray() {
+ $config = new Configuration;
+ $dbName = $config->settings->resourcesDatabaseName;
+
+ if($config->settings->resourcesModule == 'Y') {
+
+ $resourceLicenseArray = array();
+
+ $query = "SELECT * FROM " . $dbName . ".ResourceLicenseLink WHERE licenseID = '" . $this->licenseID . "'";
+
+ $result = mysqli_query($this->db->getDatabase(), $query);
+
+ while ($row = mysqli_fetch_assoc($result)){
+ $resArray = array();
+
+ //first, get the resource name
+ $query = "SELECT resourceID, titleText FROM " . $dbName . ".Resource WHERE resourceID = " . $row['resourceID'];
+
+ $resResult = mysqli_query($this->db->getDatabase(), $query);
+ while($resRow = mysqli_fetch_assoc($resResult)) {
+ $resArray['resource'] = $resRow['titleText'];
+ $resArray['resourceID'] = $resRow['resourceID'];
+ array_push($resourceLicenseArray, $resArray);
+ }
+ }
+ }
+ return $resourceLicenseArray;
+ }
+
+ //returns array of Document objects (parent documents) - used for document display on license record
+ public function getDocumentsWithoutParents($orderBy){
+
+ $query = "SELECT D.*
+ FROM Document D
+ LEFT JOIN Signature S ON (S.documentID = D.documentID)
+ LEFT JOIN DocumentType DT ON (DT.documentTypeID = D.documentTypeID)
+ WHERE licenseID = '" . $this->licenseID . "'
+ AND (D.expirationDate is null OR D.expirationDate = '0000-00-00')
+ AND (D.parentDocumentID is null OR D.parentDocumentID=0)
+ GROUP BY D.documentID
+ ORDER BY " . $orderBy . ";";
+
+ $result = $this->db->processQuery($query, 'assoc');
+
+ $objects = array();
+
+ //need to do this since it could be that there's only one request and this is how the dbservice returns result
+ if (isset($result['documentID'])){
+ $object = new Document(new NamedArguments(array('primaryKey' => $result['documentID'])));
+ array_push($objects, $object);
+ }else{
+ foreach ($result as $row) {
+ $object = new Document(new NamedArguments(array('primaryKey' => $row['documentID'])));
+ array_push($objects, $object);
+ }
+ }
+
+ return $objects;
+ }
+
+
+
+ //returns array of Document objects that are archived - used by forms to get dropdowns of available documents
+ public function getArchivedDocuments(){
+
+ $query = "SELECT D.* FROM Document D
+ LEFT JOIN Signature S ON (S.documentID = D.documentID)
+ LEFT JOIN DocumentType DT ON (DT.documentTypeID = D.documentTypeID)
+ WHERE D.documentTypeID = DT.documentTypeID
+ AND licenseID = '" . $this->licenseID . "'
+ AND (D.expirationDate is not null AND D.expirationDate != '0000-00-00')
+ GROUP BY D.documentID
+ ORDER BY D.shortName asc;";
+
+ $result = $this->db->processQuery($query, 'assoc');
+
+ $objects = array();
+
+ //need to do this since it could be that there's only one request and this is how the dbservice returns result
+ if (isset($result['documentID'])){
+ $object = new Document(new NamedArguments(array('primaryKey' => $result['documentID'])));
+ array_push($objects, $object);
+ }else{
+ foreach ($result as $row) {
+ $object = new Document(new NamedArguments(array('primaryKey' => $row['documentID'])));
+ array_push($objects, $object);
+ }
+ }
+
+ return $objects;
+ }
+
+ //returns array of Document objects that are archived - used by document display on license record
+ public function getArchivedDocumentsWithoutParents($orderBy){
+
+ $query = "SELECT D.* FROM Document D
+ LEFT JOIN Signature S ON (S.documentID = D.documentID)
+ LEFT JOIN DocumentType DT ON (DT.documentTypeID = D.documentTypeID)
+ WHERE D.documentTypeID = DT.documentTypeID
+ AND licenseID = '" . $this->licenseID . "'
+ AND (D.expirationDate is not null AND D.expirationDate != '0000-00-00')
+ AND (D.parentDocumentID is null OR D.parentDocumentID=0)
+ GROUP BY D.documentID
+ ORDER BY " . $orderBy . ";";
+
+ $result = $this->db->processQuery($query, 'assoc');
+
+ $objects = array();
+
+ //need to do this since it could be that there's only one request and this is how the dbservice returns result
+ if (isset($result['documentID'])){
+ $object = new Document(new NamedArguments(array('primaryKey' => $result['documentID'])));
+ array_push($objects, $object);
+ }else{
+ foreach ($result as $row) {
+ $object = new Document(new NamedArguments(array('primaryKey' => $row['documentID'])));
+ array_push($objects, $object);
+ }
+ }
+
+ return $objects;
+ }
+
+
+
+
+
+ //returns array of Attachment objects
+ public function getAttachments(){
+
+ $query = "SELECT * FROM Attachment where licenseID = '" . $this->licenseID . "' ORDER BY attachmentID";
+
+ $result = $this->db->processQuery($query, 'assoc');
+
+ $objects = array();
+
+ //need to do this since it could be that there's only one request and this is how the dbservice returns result
+ if (isset($result['attachmentID'])){
+ $object = new Attachment(new NamedArguments(array('primaryKey' => $result['attachmentID'])));
+ array_push($objects, $object);
+ }else{
+ foreach ($result as $row) {
+ $object = new Attachment(new NamedArguments(array('primaryKey' => $row['attachmentID'])));
+ array_push($objects, $object);
+ }
+ }
+
+ return $objects;
+ }
+
+
+
+
+ //removes this license
+ public function removeLicense(){
+
+ //delete all documents and associated expressions and SFX providers
+ $document = new Document();
+ foreach ($this->getDocuments() as $document) {
+ //delete all expressions and expression notes
+ $expression = new Expression();
+ foreach ($document->getExpressions() as $expression) {
+ $expressionNote = new ExpressionNote();
+ foreach ($expression->getExpressionNotes() as $expressionNote) {
+ $expressionNote->delete();
+ }
+
+ $expression->removeQualifiers();
+ $expression->delete();
+ }
+
+ $sfxProvider = new SFXProvider();
+ foreach ($document->getSFXProviders() as $sfxProvider) {
+ $sfxProvider->delete();
+ }
+
+ $signature = new Signature();
+ foreach ($document->getSignatures() as $signature) {
+ $signature->delete();
+ }
+
+ $document->delete();
+ }
+
+
+ //delete all attachments
+ $attachment = new Attachment();
+ foreach ($this->getAttachments() as $attachment) {
+ $attachmentFile = new AttachmentFile();
+ foreach ($attachment->getAttachmentFiles() as $attachmentFile) {
+ $attachmentFile->delete();
+ }
+ $attachment->delete();
+ }
+
+
+ $this->delete();
+ }
+
+ public function searchQuery($whereAdd, $orderBy = '', $limit = '', $count = false) {
+ if (count($whereAdd) > 0){
+ $whereStatement = " AND " . implode(" AND ", $whereAdd);
+ }else{
+ $whereStatement = "";
+ }
+
+ if ($limit != ""){
+ $limitStatement = " LIMIT " . $limit;
+ }else{
+ $limitStatement = "";
+ }
+
+ $config = new Configuration;
+
+ //if the org module is installed get the org name from org database
+ if ($config->settings->organizationsModule == 'Y') {
+ $dbName = $config->settings->organizationsDatabaseName;
+ if ($count) {
+ $select = "SELECT COUNT(DISTINCT L.licenseID) count";
+ } else {
+ $select = "SELECT distinct L.licenseID, L.shortName licenseName, O2.name consortiumName, O.name providerName, S.shortName status";
+ }
+ //now formulate query
+ $query = $select . "
+ FROM " . $dbName . ".Organization O, License L
+ LEFT JOIN " . $dbName . ".Organization O2 ON (O2.organizationID = L.consortiumID)
+ LEFT JOIN " . $dbName . ".Alias A ON (A.organizationID = L.organizationID)
+ LEFT JOIN Status S ON (S.statusID = L.statusID)
+ LEFT JOIN Document D ON (D.licenseID = L.licenseID)
+ LEFT JOIN Expression E ON (D.documentID = E.documentID)
+ WHERE O.organizationID = L.organizationID
+ " . $whereStatement;
+
+ } else {
+ if ($count) {
+ $select = "SELECT COUNT(DISTINCT L.licenseID) count";
+ } else {
+ $select = "SELECT distinct L.licenseID, L.shortName licenseName, C.shortName consortiumName, O.shortName providerName, S.shortName status";
+ }
+ //now formulate query
+ $query = $select . "
+ FROM Organization O, License L
+ LEFT JOIN Consortium C ON (C.consortiumID = L.consortiumID)
+ LEFT JOIN Status S ON (S.statusID = L.statusID)
+ LEFT JOIN Document D ON (D.licenseID = L.licenseID)
+ LEFT JOIN Expression E ON (D.documentID = E.documentID)
+ WHERE O.organizationID = L.organizationID
+ " . $whereStatement;
+
+ }
+
+ if ($orderBy) {
+ $query .= "\nORDER BY " . $orderBy;
+ }
+
+ if ($limit) {
+ $query .= "\nLIMIT " . $limit;
+ }
+
+ return $query;
+ }
+
+ public function searchCount($whereAdd) {
+ $query = $this->searchQuery($whereAdd, '', '', true);
+ $result = $this->db->processQuery(stripslashes($query), 'assoc');
+ return $result['count'];
+ }
+
+ //returns array based on search
+ public function search($whereAdd, $orderBy, $limit){
+ $query = $this->searchQuery($whereAdd, $orderBy, $limit);
+
+ $result = $this->db->processQuery(stripslashes($query), 'assoc');
+
+
+ $searchArray = array();
+ $resultArray = array();
+
+ //need to do this since it could be that there's only one result and this is how the dbservice returns result
+ if (isset($result['licenseID'])){
+
+ foreach (array_keys($result) as $attributeName) {
+ $resultArray[$attributeName] = $result[$attributeName];
+ }
+
+ array_push($searchArray, $resultArray);
+ }else{
+ foreach ($result as $row) {
+ $resultArray = array();
+ foreach (array_keys($row) as $attributeName) {
+ $resultArray[$attributeName] = $row[$attributeName];
+ }
+ array_push($searchArray, $resultArray);
+ }
+ }
+
+ return $searchArray;
+
+
+ }
+
+
+
+
+
+
+ //returns array
+ public function getInProgressLicenses(){
+ $config = new Configuration;
+
+ //if the org module is installed get the org name from org database
+ if ($config->settings->organizationsModule == 'Y'){
+ $dbName = $config->settings->organizationsDatabaseName;
+
+ //execute query to get default licenses
+ $query = "SELECT L.licenseID, L.shortName licenseName, O2.name consortiumName, O.name providerName, S.shortName status
+ FROM " . $dbName . ".Organization O, License L
+ LEFT JOIN " . $dbName . ".Organization O2 ON (O2.organizationID = L.consortiumID)
+ LEFT JOIN Status S ON (S.statusID = L.statusID)
+ WHERE O.organizationID = L.organizationID
+ AND (S.shortName in ('Editing Expressions','Awaiting Document') OR L.statusID IS NULL)
+ ORDER BY L.shortName";
+ }else{
+
+ //execute query to get default licenses
+ $query = "SELECT L.licenseID, L.shortName licenseName, C.shortName consortiumName, O.shortName providerName, S.shortName status
+ FROM Organization O, License L
+ LEFT JOIN Consortium C ON (C.consortiumID = L.consortiumID)
+ LEFT JOIN Status S ON (S.statusID = L.statusID)
+ WHERE O.organizationID = L.organizationID
+ AND (S.shortName in ('Editing Expressions','Awaiting Document') OR L.statusID IS NULL)
+ ORDER BY L.shortName";
+
+ }
+
+ $result = $this->db->processQuery($query, 'assoc');
+
+ $searchArray = array();
+ $resultArray = array();
+
+ //need to do this since it could be that there's only one result and this is how the dbservice returns result
+ if (isset($result['licenseID'])){
+
+ foreach (array_keys($result) as $attributeName) {
+ $resultArray[$attributeName] = $result[$attributeName];
+ }
+
+ array_push($searchArray, $resultArray);
+ }else{
+ foreach ($result as $row) {
+ $resultArray = array();
+ foreach (array_keys($row) as $attributeName) {
+ $resultArray[$attributeName] = $row[$attributeName];
+ }
+ array_push($searchArray, $resultArray);
+ }
+ }
+
+ return $searchArray;
+ }
+
+
+
+ //returns array of Expressions
+ public function getAllDocumentsForExpressionDisplay(){
+
+ $query="SELECT distinct D.documentID, D.shortName documentName
+ FROM Document D, Expression E
+ WHERE E.documentID = D.documentID
+ AND licenseID = '" . $this->licenseID . "' AND (D.expirationDate is null or D.expirationDate ='0000-00-00')
+ ORDER BY documentID;";
+
+ $result = $this->db->processQuery($query, 'assoc');
+
+ $objects = array();
+
+ //need to do this since it could be that there's only one request and this is how the dbservice returns result
+ if (isset($result['documentID'])){
+ $object = new Document(new NamedArguments(array('primaryKey' => $result['documentID'])));
+ array_push($objects, $object);
+ }else{
+ foreach ($result as $row) {
+ $object = new Document(new NamedArguments(array('primaryKey' => $row['documentID'])));
+ array_push($objects, $object);
+ }
+ }
+
+ return $objects;
+ }
+
+
+ //search used for the autocomplete
+ public function searchOrganizations($q){
+ $config = new Configuration;
+
+ $q = str_replace("+", " ",$q);
+ $q = str_replace("%", "&",$q);
+
+ $orgArray = array();
+
+ //if the org module is installed get the org names from org database
+ if ($config->settings->organizationsModule == 'Y'){
+
+ $dbName = $config->settings->organizationsDatabaseName;
+
+
+ $query = "SELECT CONCAT(A.name, ' (', O.name, ')') name, O.organizationID
+ FROM " . $dbName . ".Alias A, " . $dbName . ".Organization O
+ WHERE A.organizationID=O.organizationID
+ AND upper(A.name) like upper('%" . $q . "%')
+ UNION
+ SELECT name, organizationID
+ FROM " . $dbName . ".Organization
+ WHERE upper(name) like upper('%" . $q . "%')
+ ORDER BY 1;";
+
+ $result = mysqli_query($this->db->getDatabase(), $query);
+
+ while ($row = mysqli_fetch_assoc($result)){
+ $orgArray[] = $row['organizationID'] . "|" . $row['name'];
+ }
+
+
+ //otherwise get the orgs from this database
+ }else{
+ $query = "SELECT shortName, organizationID
+ FROM Organization
+ WHERE upper(shortName) like upper('%" . $q . "%')
+ ORDER BY 1;";
+
+ $result = mysqli_query($this->db->getDatabase(), $query);
+
+ while ($row = mysqli_fetch_assoc($result)){
+ $orgArray[] = $row['organizationID'] . "|" . $row['shortName'];
+ }
+
+
+ }
+
+
+ return $orgArray;
+ }
+
+
+
+
+ //search used index page drop down
+ public function getOrganizationList(){
+ $config = new Configuration;
+
+ $orgArray = array();
+
+ //if the org module is installed get the org names from org database
+ if ($config->settings->organizationsModule == 'Y'){
+ $dbName = $config->settings->organizationsDatabaseName;
+ $query = "SELECT name, organizationID FROM " . $dbName . ".Organization ORDER BY 1;";
+
+ //otherwise get the orgs from this database
+ }else{
+ $query = "SELECT shortName name, organizationID FROM Organization ORDER BY 1;";
+ }
+
+
+ $result = $this->db->processQuery($query, 'assoc');
+
+ $resultArray = array();
+
+ //need to do this since it could be that there's only one result and this is how the dbservice returns result
+ if (isset($result['organizationID'])){
+
+ foreach (array_keys($result) as $attributeName) {
+ $resultArray[$attributeName] = $result[$attributeName];
+ }
+
+ array_push($orgArray, $resultArray);
+ }else{
+ foreach ($result as $row) {
+ $resultArray = array();
+ foreach (array_keys($row) as $attributeName) {
+ $resultArray[$attributeName] = $row[$attributeName];
+ }
+ array_push($orgArray, $resultArray);
+ }
+ }
+
+ return $orgArray;
+
+ }
+
+
+
+ //go to organizations and get the org name for this license
+ public function getOrganizationName(){
+ $config = new Configuration;
+
+ //if the org module is installed get the org name from org database
+ if ($config->settings->organizationsModule == 'Y'){
+ $dbName = $config->settings->organizationsDatabaseName;
+
+ $orgArray = array();
+ $query = "SELECT name FROM " . $dbName . ".Organization WHERE organizationID = " . $this->organizationID;
+
+ if ($result = mysqli_query($this->db->getDatabase(), $query)){
+
+ while ($row = mysqli_fetch_assoc($result)){
+ return $row['name'];
+ }
+ }
+ //otherwise if the org module is not installed get the org name from this database
+ }else{
+ $organization = new Organization(new NamedArguments(array('primaryKey' => $this->organizationID)));
+ return $organization->shortName;
+ }
+ }
+
+
+
+ //insert the organization / provider if it doesn't already exist
+ public function setOrganization($orgID, $orgName){
+ $config = new Configuration;
+
+ //if the org module is installed get the org name from org database
+ if ($config->settings->organizationsModule == 'Y'){
+ //if no org ID was passed in then we need to create a new organization shell
+ if (!$orgID){
+
+ $dbName = $config->settings->organizationsDatabaseName;
+ $orgName = str_replace("'", "''",$orgName);
+
+ $query = "INSERT INTO " . $dbName . ".Organization (name, createDate, createLoginID) VALUES ('" . $orgName . "', NOW(), '" . $_SESSION['loginID'] . "')";
+
+ $this->organizationID = $this->db->processQuery($query);
+
+ }else{
+ $this->organizationID = $orgID;
+ }
+
+ //otherwise if the org module is not installed get the org name from this database
+ }else{
+
+ //if no org ID was passed in then we need to create a new provider
+ if (!$orgID){
+ $organization = new Organization();
+ $organization->organizationID = '';
+ $organization->shortName = $orgName;
+ $organization->save();
+
+ $this->organizationID = $organization->primaryKey;
+ }else{
+ $this->organizationID = $orgID;
+ }
+ }
+ }
+
+
+
+
+
+ //search used index page drop down
+ public function getConsortiumList(){
+ $config = new Configuration;
+
+ $consortiumArray = array();
+
+ //if the org module is installed get the consortia names from org database
+ if ($config->settings->organizationsModule == 'Y'){
+ $dbName = $config->settings->organizationsDatabaseName;
+ $query = "SELECT name, O.organizationID consortiumID
+ FROM " . $dbName . ".Organization O,
+ " . $dbName . ".OrganizationRoleProfile ORP,
+ " . $dbName . ".OrganizationRole
+ WHERE OrganizationRole.organizationRoleID = ORP.organizationRoleID
+ AND ORP.organizationID = O.organizationID
+ AND UPPER(OrganizationRole.shortName) LIKE 'CONSORT%'
+ ORDER BY 1;";
+
+ //otherwise get the consortium from this database
+ }else{
+ $query = "SELECT shortName name, consortiumID FROM Consortium ORDER BY 1;";
+ }
+
+
+ $result = $this->db->processQuery($query, 'assoc');
+
+ $resultArray = array();
+
+ //need to do this since it could be that there's only one result and this is how the dbservice returns result
+ if (isset($result['consortiumID'])){
+
+ foreach (array_keys($result) as $attributeName) {
+ $resultArray[$attributeName] = $result[$attributeName];
+ }
+
+ array_push($consortiumArray, $resultArray);
+ }else{
+ foreach ($result as $row) {
+ $resultArray = array();
+ foreach (array_keys($row) as $attributeName) {
+ $resultArray[$attributeName] = $row[$attributeName];
+ }
+ array_push($consortiumArray, $resultArray);
+ }
+ }
+
+ return $consortiumArray;
+
+ }
+
+
+
+ //go to organizations and get the consortia name for this license
+ public function getConsortiumName(){
+ $config = new Configuration;
+
+ //if the org module is installed get the org name from org database
+ if ($config->settings->organizationsModule == 'Y'){
+ $dbName = $config->settings->organizationsDatabaseName;
+
+ $orgArray = array();
+ $query = "SELECT name FROM " . $dbName . ".Organization WHERE organizationID = " . $this->consortiumID;
+ $result = mysqli_query($this->db->getDatabase(), $query);
+
+ while ($row = mysqli_fetch_assoc($result)){
+ return $row['name'];
+ }
+ //otherwise if the org module is not installed get the consortium name from this database
+ }else{
+ $consortium = new Consortium(new NamedArguments(array('primaryKey' => $this->consortiumID)));
+ return $consortium->shortName;
+ }
+ }
+
+
+
+ //used for A-Z on search (index)
+ public function getAlphabeticalList(){
+ $alphArray = array();
+ $result = mysqli_query($this->db->getDatabase(), "SELECT DISTINCT UPPER(SUBSTR(TRIM(LEADING 'The ' FROM shortName),1,1)) letter, COUNT(SUBSTR(TRIM(LEADING 'The ' FROM shortName),1,1)) letter_count
+ FROM License L
+ GROUP BY SUBSTR(TRIM(LEADING 'The ' FROM shortName),1,1)
+ ORDER BY 1;");
+
+ while ($row = mysqli_fetch_assoc($result)){
+ $alphArray[$row['letter']] = $row['letter_count'];
+ }
+
+ return $alphArray;
+ }
+
+
+}
+
+?>
diff --git a/admin/configuration_sample.ini b/admin/configuration_sample.ini
index f50e708..ebe9b39 100644
--- a/admin/configuration_sample.ini
+++ b/admin/configuration_sample.ini
@@ -6,6 +6,8 @@ authDatabaseName=
usageModule=N
resourcesModule=N
resourcesDatabaseName=
+managementModule=
+managementDatabaseName=
useTermsToolFunctionality=N
remoteAuthVariableName="_SERVER['REMOTE_USER']"
diff --git a/ajax_forms.php b/ajax_forms.php
index 8594d72..e6bff58 100644
--- a/ajax_forms.php
+++ b/ajax_forms.php
@@ -42,19 +42,19 @@