adding docu, some cleanup
This commit is contained in:
@@ -17,10 +17,11 @@ dbConnector::connect(
|
||||
|
||||
$userId = 1;
|
||||
$apiKey = ApiKey::create();
|
||||
$rightString = 'event:' . PHP_EOL . ' id: 1';
|
||||
$rightArray = Spyc::YAMLLoadString($rightString);
|
||||
// $rightString = 'event:' . PHP_EOL . ' id: 1';
|
||||
// $rightArray = Spyc::YAMLLoadString($rightString);
|
||||
$right = 'login';
|
||||
$date = new DateTime();
|
||||
$newKey = new ApiKey(null, $userId, $apiKey, $rightString, $date->format('Y-m-d'));
|
||||
$newKey = new ApiKey(null, $userId, $apiKey, $right, $date->format('Y-m-d'));
|
||||
$newKey->addToDb();
|
||||
$loadedKey = ApiKey::loadFromDb($apiKey);
|
||||
|
||||
@@ -29,7 +30,7 @@ $loadedKey = ApiKey::loadFromDb($apiKey);
|
||||
<html>
|
||||
<body>
|
||||
<ul>
|
||||
<li>rightsRoundabout: <?echo( $loadedKey->isValidFor($rightArray) ? 'TRUE' : 'FALSE' );?></li>
|
||||
<li>rightsRoundabout: <?echo( $loadedKey->isValidFor($right) ? 'TRUE' : 'FALSE' );?></li>
|
||||
</ul>
|
||||
</body>
|
||||
<html>
|
||||
Reference in New Issue
Block a user