Skip to content

Commit

Permalink
Merge pull request #29 from SEINetNetwork/master
Browse files Browse the repository at this point in the history
Update to 3.0 via merge of BioKIC/Symbiota developments
  • Loading branch information
egbot authored Sep 6, 2023
2 parents 3b9a70e + a6b5613 commit f41f9c0
Show file tree
Hide file tree
Showing 237 changed files with 17,269 additions and 11,624 deletions.
42 changes: 21 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
This fork of the Symbiota code is actively being developed by the Biodiversity Knowledge Integration Center (BioKIC, https://github.com/BioKIC) development team at Arizona State University.
Even though BioKIC code developments are regularly pushed back to this repository, we recommend that you download/fork code directly from the
BioKIC/Symbiota repository (https://github.com/BioKIC/Symbiota) to ensure that you obtain the most recently code changes.
This fork of the Symbiota code is actively being developed by the Biodiversity Knowledge Integration Center (BioKIC, https://github.com/BioKIC) development team at Arizona State University.
Even though BioKIC code developments are regularly pushed back to this repository, we recommend that you download/fork code directly from the
BioKIC/Symbiota repository (https://github.com/BioKIC/Symbiota) to ensure that you obtain the most recently code changes.

# Welcome to the Symbiota code repository

### ABOUT THIS SOFTWARE
## ABOUT THIS SOFTWARE

The Symbiota Software Project is building a library of webtools to aid biologists in establishing specimen based virtual floras and faunas. This project developed from the realization that complex, information rich biodiversity portals are best built through collaborative efforts between software developers, biologist, wildlife managers, and citizen scientist. The central premise of this open source software project is that through a partnership between software engineers and scientific community, higher quality and more publicly useful biodiversity portals can be built. An open source software framework allows the technicians to create the tools, thus freeing the biologist to concentrate their efforts on the curation of quality datasets. In this manor, we can create
something far greater than a single entity is capable of doing on their own.
The Symbiota Software Project is building a library of webtools to aid biologists in establishing specimen based virtual floras and faunas. This project developed from the realization that complex, information rich biodiversity portals are best built through collaborative efforts between software developers, biologist, wildlife managers, and citizen scientist. The central premise of this open source software project is that through a partnership between software engineers and the scientific community, higher quality and more publicly useful biodiversity portals can be built. An open source software framework allows the technicians to create the tools, thus freeing the biologist to concentrate their efforts on the curation of quality datasets. In this manner, we can create something far greater than a single entity is capable of doing on their own.

More information about this project can be accessed through [https://symbiota.org](https://symbiota.org).

More information about this project can be accessed through [https://symbiota.org](https://symbiota.org).
For documentation and user guides please visit [Symbiota Docs](https://symbiota.org/docs).

## ACKNOWLEDGEMENTS
Expand All @@ -18,26 +18,26 @@ Symbiota has been generously funded by the National Science Foundation (DBI-0743

## FEATURES

* Specimen Search Engine
* Taxonomic Thesaurus for querying taxonomic synonyms
* Google Map and Google Earth mapping capabilities
* Dynamic species list generated from specimens records
* Flora/Fauna Management System
* Static species list (local floras/faunas)
* Interactive Identification Keys
* Key generation for are species list within system
* Key generator based on a point locality
* Image Library

- Specimen Search Engine
- Taxonomic Thesaurus for querying taxonomic synonyms
- Google Map and Google Earth mapping capabilities
- Dynamic species list generated from specimens records
- Flora/Fauna Management System
- Static species list (local floras/faunas)
- Interactive Identification Keys
- Key generation for are species list within system
- Key generator based on a point locality
- Image Library

## LIMITATIONS

* Tested thoroughly on Linux and Windows operating systems
* Code should work with an PHP enabled web server, though central development and testing done using Apache HTTP Server

- Tested thoroughly on Linux and Windows operating systems
- Code should work with an PHP enabled web server, though central development and testing done using Apache HTTP Server

## INSTALLATION

Please read the [INSTALL.md](docs/INSTALL.md) file for installation instructions.

## UPDATES

Please read the [UPDATE.md](docs/UPDATE.md) file for instructions on how to update Symbiota.
14 changes: 9 additions & 5 deletions admin/schemamanager.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
$verHistory = $schemaManager->getVersionHistory();
$curentVersion = $schemaManager->getCurrentVersion();

if(!$IS_ADMIN && $curentVersion) header('Location: ../../profile/index.php?refurl=../admin/schemamanager.php');
//if(!$IS_ADMIN && $curentVersion) header('Location: ../profile/index.php?refurl=../admin/schemamanager.php');
$IS_ADMIN = true;
?>
<html>
<head>
Expand Down Expand Up @@ -52,6 +53,8 @@
$schemaManager->setPort($port);
$schemaManager->setUsername($username);
$schemaManager->installPatch();
$verHistory = $schemaManager->getVersionHistory();
$curentVersion = $schemaManager->getCurrentVersion();
}
?>
</fieldset>
Expand Down Expand Up @@ -86,10 +89,11 @@
<div class="form-section">
<label>Schema: </label>
<select name="schemaCode">
<option value="1.0" <?php echo !$curentVersion || $curentVersion < 1 ? 'selected' : ''; ?>>Base Schema 1.0</option>
<option value="1.1"<?php echo $curentVersion == 1.0 ? 'selected' : ''; ?>>Schema Patch 1.1</option>
<option value="1.2"<?php echo $curentVersion == 1.1 ? 'selected' : ''; ?>>Schema Patch 1.2</option>
<option value="2.0"<?php echo $curentVersion == 1.2 ? 'selected' : ''; ?>>Schema Patch 2.0</option>
<option value="baseInstall" <?php echo !$curentVersion || $curentVersion < 1 ? 'selected' : ''; ?>>New Install (ver. 3.0)</option>
<option value="1.1" <?php echo $curentVersion == 1.0 ? 'selected' : ''; ?>>Schema Patch 1.1</option>
<option value="1.2" <?php echo $curentVersion == 1.1 ? 'selected' : ''; ?>>Schema Patch 1.2</option>
<option value="3.0" <?php echo $curentVersion == 1.2 ? 'selected' : ''; ?>>Schema Patch 3.0</option>
<option value="" <?php echo $curentVersion == 3.0 ? 'selected' : ''; ?>>Schema is Current - nothing to do</option>
</select>
</div>
<div class="form-section">
Expand Down
51 changes: 49 additions & 2 deletions api/app/Http/Controllers/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,22 @@
namespace App\Http\Controllers;

use Laravel\Lumen\Routing\Controller as BaseController;
use Illuminate\Http\Request;
use App\Models\Collection;
use App\Models\UserAccessToken;
use App\Models\UserRole;

include_once('../config/symbini.php');
$_ENV['DEFAULT_TITLE'] = $DEFAULT_TITLE;
$_ENV['PORTAL_GUID'] = $PORTAL_GUID;
$_ENV['SECURITY_KEY'] = $SECURITY_KEY;
$_ENV['DEFAULT_TITLE'] = $DEFAULT_TITLE;
$_ENV['ADMIN_EMAIL'] = $ADMIN_EMAIL;
$_ENV['CLIENT_ROOT'] = $CLIENT_ROOT;
$_ENV['SYMBIOTA_VERSION'] = $CODE_VERSION;

class Controller extends BaseController
{

class Controller extends BaseController{
/**
* @OA\Info(
* title="Symbiota API",
Expand All @@ -28,4 +33,46 @@ class Controller extends BaseController
/**
* @OA\Server(url="../")
*/

public function __construct(){
}

/**
* Authorization of writable actions or sensitive locality requests
*
* Input: security token
* Return: user object with role/permission settings
*/
public function authenicate(Request $request){
$this->validate($request, [
'apiToken' => 'required'
]);
$apiToken = $request->input('apiToken');

//TODO: convert to an actual user object
$userArr = false;

if($_ENV['SECURITY_KEY'] == $apiToken){
//Matches portal's global security key set by administrator, which provides administrative level access
$userArr = array();
$userArr['roles'][] = array('role' => 'SuperAdmin');
}
else{
//See if security key matches keys associated with collections, if so, request is an admin of collection
$collid = Collection::where('securityKey', $apiToken)->value('collid');
$userArr = array();
if($collid){
$userArr['roles'][] = array('role' => 'CollAdmin', 'tableName' => 'omcollections', 'tablePK' => $collid);
}
else{
$uid = UserAccessToken::where('token', $apiToken)->value('uid');
if($uid){
//Check user security tokens
$userArr['uid'] = $uid;
$userArr['roles'] = UserRole::where('uid', $uid)->get(['role', 'tableName', 'tablePk'])->toArray();
}
}
}
return $userArr;
}
}
Loading

0 comments on commit f41f9c0

Please sign in to comment.