public function createChecklist($newClArr)
 {
     $sqlInsert = "";
     $sqlValues = "";
     foreach ($newClArr as $k => $v) {
         $sqlInsert .= ',' . $k;
         if ($v) {
             $sqlValues .= ',"' . $this->cleanInStr($v) . '"';
         } else {
             $sqlValues .= ',NULL';
         }
     }
     $sql = "INSERT INTO fmchecklists (" . substr($sqlInsert, 1) . ") VALUES (" . substr($sqlValues, 1) . ")";
     //echo $sql; exit;
     $newClId = 0;
     if ($this->conn->query($sql)) {
         $newClId = $this->conn->insert_id;
         //Set permissions to allow creater to be an editor
         $this->conn->query('INSERT INTO userroles (uid, role, tablename, tablepk) VALUES(' . $GLOBALS["SYMB_UID"] . ',"ClAdmin","fmchecklists",' . $newClId . ') ');
         //$this->conn->query("INSERT INTO userpermissions (uid, pname) VALUES(".$GLOBALS["symbUid"].",'ClAdmin-".$newClId."') ");
         $newPManager = new ProfileManager();
         $newPManager->setUserName($GLOBALS['USERNAME']);
         $newPManager->authenticate();
     }
     return $newClId;
 }
示例#2
0
 public function addUser($uid, $taxa, $editorStatus, $geographicScope, $notes)
 {
     $statusStr = '';
     $profileManager = new ProfileManager();
     $profileManager->setUid($uid);
     $statusStr = $profileManager->addUserTaxonomy($taxa, $editorStatus, $geographicScope, $notes);
     return $statusStr;
 }
示例#3
0
 /**
  * @return \Aws\Sdk
  */
 public static function getSdk($profile = 'default')
 {
     if (!isset(self::$sdks[$profile])) {
         $params = ['version' => 'latest', 'region' => getenv('AWS_DEFAULT_REGION'), 'retries' => 20];
         if ($profile != 'default') {
             $profileManager = new ProfileManager();
             $profileConfig = $profileManager->getProfileConfig($profile);
             $params['region'] = $profileConfig['region'];
             $params['credentials'] = ['key' => $profileConfig['access_key'], 'secret' => $profileConfig['secret_key']];
         }
         self::$sdks[$profile] = new \Aws\Sdk($params);
     }
     return self::$sdks[$profile];
 }
 public function userCreated(UMEvent $e)
 {
     if ($e->getSource() instanceof AbstractEyeosUser) {
         $userDirPath = UMManager::getEyeosUserDirectory($e->getSource()->getName());
         $skel = utf8_basename($e->getSkel());
         AdvancedPathLib::cpdirs(SYSTEM_SKEL_PATH . '/' . USERS_DIR . '/profiles/' . $skel . '/skel_files/', $userDirPath, false);
         ProfileManager::executeProfile(new Profile($skel), $e->getSource());
     }
 }
示例#5
0
<?php

include_once '../config/symbini.php';
include_once $serverRoot . '/classes/PermissionsManager.php';
include_once $serverRoot . '/classes/ProfileManager.php';
header("Content-Type: text/html; charset=" . $charset);
$loginAs = array_key_exists("loginas", $_REQUEST) ? trim($_REQUEST["loginas"]) : "";
$searchTerm = array_key_exists("searchterm", $_REQUEST) ? trim($_REQUEST["searchterm"]) : "";
$userId = array_key_exists("userid", $_REQUEST) ? $_REQUEST["userid"] : "";
$delRole = array_key_exists("delrole", $_REQUEST) ? $_REQUEST["delrole"] : "";
$tablePk = array_key_exists("tablepk", $_REQUEST) ? $_REQUEST["tablepk"] : "";
$userManager = new PermissionsManager();
if ($isAdmin) {
    if ($loginAs) {
        $pHandler = new ProfileManager();
        $pHandler->setUserName($loginAs);
        $pHandler->authenticate();
        header("Location: ../index.php");
    } elseif ($delRole) {
        $userManager->deletePermission($userId, $delRole, $tablePk);
    } elseif (array_key_exists("apsubmit", $_POST)) {
        foreach ($_POST["p"] as $pname) {
            $role = $pname;
            $tablePk = '';
            if (strpos($pname, '-')) {
                $tok = explode('-', $pname);
                $role = $tok[0];
                $tablePk = $tok[1];
            }
            $userManager->addPermission($userId, $role, $tablePk);
        }
示例#6
0
include_once $serverRoot . '/classes/ProfileManager.php';
$useRecaptcha = false;
if (isset($RECAPTCHA_PUBLIC_KEY) && $RECAPTCHA_PUBLIC_KEY && isset($RECAPTCHA_PRIVATE_KEY) && $RECAPTCHA_PRIVATE_KEY) {
    require_once 'recaptchalib.php';
    $useRecaptcha = true;
}
header("Content-Type: text/html; charset=" . $charset);
header('Cache-Control: no-cache, no-cache="set-cookie", no-store, must-revalidate');
header('Pragma: no-cache');
// HTTP 1.0.
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT");
// Date in the past
$login = array_key_exists('login', $_POST) ? $_POST['login'] : '';
$emailAddr = array_key_exists('emailaddr', $_POST) ? $_POST['emailaddr'] : '';
$action = array_key_exists("submit", $_REQUEST) ? $_REQUEST["submit"] : '';
$pHandler = new ProfileManager();
$displayStr = '';
//Sanitation
if ($login) {
    if (!$pHandler->setUserName($login)) {
        $login = '';
        $displayStr = 'Invalid login name';
    }
}
if ($emailAddr) {
    if (!$pHandler->validateEmailAddress($emailAddr)) {
        $emailAddr = '';
        $displayStr = 'Invalid login name';
    }
}
if ($action && !preg_match('/^[a-zA-Z0-9\\s_]+$/', $action)) {
<?php

include_once '../config/symbini.php';
include_once $serverRoot . '/classes/ProfileManager.php';
header("Content-Type: text/html; charset=" . $charset);
$collId = $_REQUEST["collid"];
$action = array_key_exists("formsubmit", $_REQUEST) ? $_REQUEST["formsubmit"] : '';
$cSet = array_key_exists("cset", $_REQUEST) ? $_REQUEST["cset"] : 'utf8';
$zipFile = array_key_exists("zipfile", $_REQUEST) ? $_REQUEST["zipfile"] : 0;
$dlManager = new ProfileManager();
$dlManager->setUid($symbUid);
$editable = 0;
if ($isAdmin || array_key_exists("CollAdmin", $userRights) && in_array($collId, $userRights["CollAdmin"]) || array_key_exists("CollEditor", $userRights) && in_array($collId, $userRights["CollEditor"])) {
    $editable = 1;
}
?>

<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=<?php 
echo $charset;
?>
">
	<meta http-equiv="X-Frame-Options" content="deny">
	<title>Personal Specimen Backup</title>
	<link href="../css/base.css?<?php 
echo $CSS_VERSION;
?>
" type="text/css" rel="stylesheet" />
	<link href="../css/main.css?<?php 
echo $CSS_VERSION;
示例#8
0
 public static function getProfiles()
 {
     return ProfileManager::listProfiles();
 }
示例#9
0
                foreach ($v as $v2) {
                    $refGetStr .= "&attr[]=" . $v2;
                }
            } else {
                $refGetStr .= "&" . $k . "=" . $v;
            }
        }
    }
    $refUrl = str_replace('&amp;', '&', htmlspecialchars($_REQUEST["refurl"]));
    if (substr($refUrl, -4) == ".php") {
        $refUrl .= "?" . substr($refGetStr, 1);
    } else {
        $refUrl .= $refGetStr;
    }
}
$pHandler = new ProfileManager();
$statusStr = "";
//Sanitation
if ($login) {
    if (!$pHandler->setUserName($login)) {
        $login = '';
        $statusStr = 'Invalid login name';
    }
}
if ($emailAddr) {
    if (!$pHandler->validateEmailAddress($emailAddr)) {
        $emailAddr = '';
        $statusStr = 'Invalid email';
    }
}
if (!is_numeric($resetPwd)) {
示例#10
0
<?php

include_once '../config/symbini.php';
include_once $serverRoot . '/classes/ProfileManager.php';
header("Content-Type: text/html; charset=" . $charset);
$userId = $_REQUEST["userid"];
//Sanitation
if (!is_numeric($userId)) {
    $userId = 0;
}
$pHandler = new ProfileManager();
$pHandler->setUid($userId);
$person = $pHandler->getPerson();
$isSelf = true;
if ($userId != $SYMB_UID) {
    $isSelf = false;
}
?>
<div style="padding:15px;">
	<div>
		<div>
			<b><u>Profile Details</u></b>
		</div>
		<div style="margin:20px;">
			<?php 
echo '<div>' . $person->getFirstName() . ' ' . $person->getLastName() . '</div>';
if ($person->getTitle()) {
    echo '<div>' . $person->getTitle() . '</div>';
}
if ($person->getInstitution()) {
    echo '<div>' . $person->getInstitution() . '</div>';
示例#11
0
<?php

include_once '../config/symbini.php';
include_once $serverRoot . '/classes/ProfileManager.php';
header("Content-Type: text/html; charset=" . $charset);
$collId = array_key_exists("collid", $_REQUEST) ? $_REQUEST["collid"] : 0;
$formSubmit = array_key_exists("formsubmit", $_REQUEST) ? $_REQUEST["formsubmit"] : "";
$specHandler = new ProfileManager();
$collArr = array();
if ($symbUid) {
    $specHandler->setUid($symbUid);
    $collArr = $specHandler->getPersonalCollectionArr();
}
$statusStr = '';
?>
<div style="margin:10px;">
<?php 
if ($symbUid) {
    //Collection is defined and User is logged-in and have permissions
    if ($statusStr) {
        ?>
		<hr/>
		<div style="margin:15px;color:red;">
			<?php 
        echo $statusStr;
        ?>
		</div>
		<hr/>
		<?php 
    }
    if (array_key_exists('observation', $collArr)) {
示例#12
0
if (isset($SYMB_UID) && $SYMB_UID) {
    if (!$userId) {
        $userId = $SYMB_UID;
    }
    if ($userId == $SYMB_UID) {
        $isSelf = 1;
    }
    if ($isSelf || $isAdmin) {
        $isEditor = 1;
    }
}
if (!$userId) {
    header('Location: index.php?refurl=viewprofile.php');
}
$statusStr = "";
$pHandler = new ProfileManager();
$pHandler->setUid($userId);
$pClManager = new PersonalChecklistManager();
$person = null;
if ($isEditor) {
    // ******************************  editing a profile  ************************************//
    if ($action == "Submit Edits") {
        $firstname = $_REQUEST["firstname"];
        $lastname = $_REQUEST["lastname"];
        $email = $_REQUEST["email"];
        $title = array_key_exists("title", $_REQUEST) ? $_REQUEST["title"] : "";
        $institution = array_key_exists("institution", $_REQUEST) ? $_REQUEST["institution"] : "";
        $city = array_key_exists("city", $_REQUEST) ? $_REQUEST["city"] : "";
        $state = array_key_exists("state", $_REQUEST) ? $_REQUEST["state"] : "";
        $zip = array_key_exists("zip", $_REQUEST) ? $_REQUEST["zip"] : "";
        $country = array_key_exists("country", $_REQUEST) ? $_REQUEST["country"] : "";
示例#13
0
<?php

include_once '../config/symbini.php';
include_once $serverRoot . '/classes/ProfileManager.php';
header("Content-Type: text/html; charset=" . $charset);
$userId = $_REQUEST['userid'];
$action = array_key_exists('action', $_REQUEST) ? $_REQUEST['action'] : '';
//Sanitation
if (!is_numeric($userId)) {
    $userId = 0;
}
if ($action && !preg_match('/^[a-zA-Z0-9\\s_]+$/', $action)) {
    $action = '';
}
$profileHandler = new ProfileManager();
$profileHandler->setUid($SYMB_UID);
?>
<div style="margin:10px;">
	<?php 
if ($SYMB_UID) {
    if ($action == 'showmissingids') {
        $profileHandler->echoSpecimensLackingIdent();
    } else {
        $profileHandler->echoSpecimensPendingIdent();
    }
}
?>
	
	<div style="margin:25px 15px;">
		<?php 
if ($userId) {
								<ul>
									<li>
										<a href="#occdiv"  style="margin:0px 20px 0px 20px;">
											<?php 
            if ($occId) {
                echo 'Occurrence Data';
            } else {
                echo '<span style="color:red;">New Occurrence Record</span>';
            }
            ?>
										</a>
									</li>
									<?php 
            if ($occId && $isEditor) {
                // Get symbiota user email as the annotator email (for fp)
                $pHandler = new ProfileManager();
                $pHandler->setUid($symbUid);
                $person = $pHandler->getPerson();
                $userEmail = $person ? $person->getEmail() : '';
                $anchorVars = 'occid=' . $occId . '&occindex=' . $occIndex . '&csmode=' . $crowdSourceMode . '&collid=' . $collId;
                $detVars = 'identby=' . urlencode($occArr['identifiedby']) . '&dateident=' . urlencode($occArr['dateidentified']) . '&sciname=' . urlencode($occArr['sciname']) . '&em=' . $isEditor . '&annotatorname=' . urlencode($userDisplayName) . '&annotatoremail=' . urlencode($userEmail) . (isset($collMap['collectioncode']) ? '&collectioncode=' . urlencode($collMap['collectioncode']) : '') . (isset($collMap['institutioncode']) ? '&institutioncode=' . urlencode($collMap['institutioncode']) : '') . '&catalognumber=' . urlencode($occArr['catalognumber']);
                ?>
										<li id="detTab">
											<a href="includes/determinationtab.php?<?php 
                echo $anchorVars . '&' . $detVars;
                ?>
"
												style="margin:0px 20px 0px 20px;">Determination History</a>
										</li>
										<?php 
                if (isset($fpEnabled) && $fpEnabled) {
 public function createChecklist($postArr)
 {
     $sqlInsert = "";
     $sqlValues = "";
     $fieldArr = array('name' => 's', 'authors' => 's', 'type' => 's', 'locality' => 's', 'publication' => 's', 'abstract' => 's', 'notes' => 's', 'latcentroid' => 'n', 'longcentroid' => 'n', 'pointradiusmeters' => 'n', 'footprintWKT' => 's', 'parentclid' => 'n', 'access' => 's', 'uid' => 'n');
     foreach ($fieldArr as $fieldName => $fieldType) {
         $sqlInsert .= ',' . $fieldName;
         $v = $this->cleanInStr($postArr[$fieldName]);
         if ($fieldName != 'abstract') {
             $v = strip_tags($v, '<i><u><b><a>');
         }
         if ($v) {
             if ($fieldType == 's') {
                 $sqlValues .= ',"' . $v . '"';
             } else {
                 if (is_numeric($v)) {
                     $sqlValues .= ',' . $v;
                 } else {
                     $sqlValues .= ',NULL';
                 }
             }
         } else {
             $sqlValues .= ',NULL';
         }
     }
     $sql = "INSERT INTO fmchecklists (" . substr($sqlInsert, 1) . ") VALUES (" . substr($sqlValues, 1) . ")";
     $newClId = 0;
     if ($this->conn->query($sql)) {
         $newClId = $this->conn->insert_id;
         //Set permissions to allow creater to be an editor
         $this->conn->query('INSERT INTO userroles (uid, role, tablename, tablepk) VALUES(' . $GLOBALS["SYMB_UID"] . ',"ClAdmin","fmchecklists",' . $newClId . ') ');
         //$this->conn->query("INSERT INTO userpermissions (uid, pname) VALUES(".$GLOBALS["symbUid"].",'ClAdmin-".$newClId."') ");
         $newPManager = new ProfileManager();
         $newPManager->setUserName($GLOBALS['USERNAME']);
         $newPManager->authenticate();
     }
     return $newClId;
 }