register starts is now possible in the new materialize version
This commit is contained in:
35
homepage/participo/apiKeyTest.php
Normal file
35
homepage/participo/apiKeyTest.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
require_once 'config/participo.php';
|
||||
|
||||
require_once './local/cwsvJudo.php';
|
||||
|
||||
require_once 'participoLib/participo.php';
|
||||
require_once 'participoLib/apiKey.php';
|
||||
|
||||
require_once 'spyc/Spyc.php';
|
||||
|
||||
dbConnector::connect(
|
||||
$cwsvJudoConfig['db']['host'],
|
||||
$cwsvJudoConfig['db']['name'],
|
||||
$cwsvJudoConfig['db']['user'],
|
||||
$cwsvJudoConfig['db']['password']
|
||||
);
|
||||
|
||||
$userId = 1;
|
||||
$apiKey = ApiKey::create();
|
||||
$rightString = 'event:' . PHP_EOL . ' id: 1';
|
||||
$rightArray = Spyc::YAMLLoadString($rightString);
|
||||
$date = new DateTime();
|
||||
$newKey = new ApiKey(null, $userId, $apiKey, $rightString, $date->format('Y-m-d'));
|
||||
$newKey->addToDb();
|
||||
$loadedKey = ApiKey::loadFromDb($apiKey);
|
||||
|
||||
?>
|
||||
<!doctype html>
|
||||
<html>
|
||||
<body>
|
||||
<ul>
|
||||
<li>rightsRoundabout: <?echo( $loadedKey->isValidFor($rightArray) ? 'TRUE' : 'FALSE' );?></li>
|
||||
</ul>
|
||||
</body>
|
||||
<html>
|
||||
Reference in New Issue
Block a user