Skip to content

Commit

Permalink
Fixed bug, changed default settings, added more info to composer.json
Browse files Browse the repository at this point in the history
  • Loading branch information
jonasgeiler committed Jan 16, 2020
1 parent e54b652 commit dc88dcb
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 14 deletions.
14 changes: 9 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "skayocrafts/cage",
"description": "An Age-Verification-Gate Plugin for Craft CMS",
"type": "craft-plugin",
"version": "1.0.0",
"version": "1.0.1",
"keywords": [
"craft",
"cms",
Expand Down Expand Up @@ -30,18 +30,21 @@
"21"
],
"support": {
"docs": "https://github.com/SkayoCrafts/cage/blob/master/README.md",
"issues": "https://github.com/SkayoCrafts/cage/issues"
"email": "[email protected]",
"docs": "https://skayocrafts.github.io/cage/docs",
"issues": "https://github.com/SkayoCrafts/Cage/issues",
"source": "https://github.com/SkayoCrafts/Cage"
},
"license": "proprietary",
"authors": [
{
"name": "Skayo",
"homepage": "https://skayo.github.io"
"homepage": "https://skayo.github.io",
"email": "[email protected]"
}
],
"require": {
"craftcms/cms": "^3.0.0-RC1"
"craftcms/cms": "^3.1.0"
},
"autoload": {
"psr-4": {
Expand All @@ -52,6 +55,7 @@
"name": "Cage",
"handle": "cage",
"changelogUrl": "https://raw.githubusercontent.com/SkayoCrafts/cage/master/CHANGELOG.md",
"documentationUrl": "https://skayocrafts.github.io/cage/docs",
"class": "skayocrafts\\cage\\Cage"
}
}
2 changes: 1 addition & 1 deletion src/Cage.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ class Cage extends Plugin {
/**
* @inheritDoc
*/
public $minVersionRequired = '3.0.0';
public $minVersionRequired = '3.1.0';

// Public Methods
// =========================================================================
Expand Down
6 changes: 4 additions & 2 deletions src/controllers/AgeVerificationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public function actionIndex () {

// Check logged in setting
if ($settings->ignoreLoggedIn && Craft::$app->getUser()
->getIdentity() === null) {
->getIdentity() !== null) {
return $response->redirect($referer);
}

Expand Down Expand Up @@ -137,7 +137,9 @@ public function actionIndex () {
}

if ($yearValid) {
$age = date('Y') - $year;
$birthDate = new DateTime($year . '-01-01');
$today = new DateTime('today');
$age = $birthDate->diff($today)->y;

if ($age >= $requiredAge) {
$userAge = $age;
Expand Down
1 change: 0 additions & 1 deletion src/controllers/SettingsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ public function actionEditSettings (string $settingsSection = 'general') : Respo
->getConfigFromFile(strtolower(Cage::$plugin->handle));

$variables['overrides'] = array_keys($overrides);

/* */

return $this->renderTemplate("cage/settings/$settingsSection", $variables);
Expand Down
10 changes: 5 additions & 5 deletions src/models/Settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ class Settings extends Model {
*
* @var string An RGB color
*/
public $backgroundColor = "rgba(0, 0, 0, 0.6)";
public $backgroundColor = "rgba(0, 0, 0, 0.9)";

/**
* The background image of the age verification page
Expand Down Expand Up @@ -258,14 +258,14 @@ class Settings extends Model {
*
* @var string An RGB color
*/
public $textColor = 'rgb(0, 0, 0)';
public $textColor = 'rgb(42, 42, 42)';

/**
* The background color of the enter button
*
* @var string An RGB color
*/
public $enterButtonBackgroundColor = 'rgb(221, 151, 0)';
public $enterButtonBackgroundColor = 'rgb(0, 81, 255)';

/**
* The text color of the enter button
Expand Down Expand Up @@ -293,14 +293,14 @@ class Settings extends Model {
*
* @var string An RGB color
*/
public $leaveButtonTextColor = 'rgb(0, 0, 0)';
public $leaveButtonTextColor = 'rgb(0, 81, 255)';

/**
* The border color of the leave button
*
* @var string An RGB color
*/
public $leaveButtonBorderColor = 'rgba(0, 0, 0, 0.4)';
public $leaveButtonBorderColor = 'rgb(0, 81, 255)';

/**
* The background color of drop-downs/input fields
Expand Down

0 comments on commit dc88dcb

Please sign in to comment.