Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
colintucker committed Jun 12, 2018
2 parents 1af24eb + f43b075 commit d4cdc49
Show file tree
Hide file tree
Showing 19 changed files with 291 additions and 255 deletions.
16 changes: 4 additions & 12 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
Thumbs.db

### Folder Config ###
.directory
.DS_Store
Desktop.ini

Expand All @@ -16,7 +17,7 @@ Desktop.ini
/vendor

### Node.js Packages ###
/**/node_modules
node_modules/

### Sass Cache ###
.sass-cache
Expand All @@ -27,21 +28,12 @@ Desktop.ini

### Environment Config ###
.env
_ss_environment.php

### SilverStripe Cache ###
/silverstripe-cache

### SilverStripe Assets ###
/assets/*
/assets/Uploads/*
!/assets/.htaccess
!/assets/web.config
!/assets/Uploads/
!/assets/Uploads/silverware-logo.png
silverstripe-cache/

### SilverStripe Resources ###
/resources
resources/

### SilverStripe Themes ###
/themes/silverware-theme
58 changes: 2 additions & 56 deletions .htaccess
Original file line number Diff line number Diff line change
@@ -1,56 +1,2 @@
### SILVERSTRIPE START ###

# Deny access to templates (but allow from localhost)
<Files *.ss>
Order deny,allow
Deny from all
Allow from 127.0.0.1
</Files>

# Deny access to IIS configuration
<Files web.config>
Order deny,allow
Deny from all
</Files>

# Deny access to YAML configuration files which might include sensitive information
<Files ~ "\.ya?ml$">
Order allow,deny
Deny from all
</Files>

# Route errors to static pages automatically generated by SilverStripe
ErrorDocument 404 /assets/error-404.html
ErrorDocument 500 /assets/error-500.html

<IfModule mod_rewrite.c>

# Turn off index.php handling requests to the homepage fixes issue in apache >=2.4
<IfModule mod_dir.c>
DirectoryIndex disabled
DirectorySlash On
</IfModule>

SetEnv HTTP_MOD_REWRITE On
RewriteEngine On

# Enable HTTP Basic authentication workaround for PHP running in CGI mode
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

# Deny access to potentially sensitive files and folders
RewriteRule ^vendor(/|$) - [F,L,NC]
RewriteRule ^\.env - [F,L,NC]
RewriteRule silverstripe-cache(/|$) - [F,L,NC]
RewriteRule composer\.(json|lock) - [F,L,NC]
RewriteRule (error|silverstripe|debug)\.log - [F,L,NC]

# Process through SilverStripe if no file with the requested name exists.
# Pass through the original path as a query parameter, and retain the existing parameters.
# Try finding framework in the vendor folder first
RewriteCond %{REQUEST_URI} ^(.*)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule .* index.php

</IfModule>

### SILVERSTRIPE END ###
RewriteEngine On
RewriteRule ^(.*)$ public/$1
10 changes: 10 additions & 0 deletions app/_config.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
* @link {project-link}
*/

use SilverStripe\Security\Member;
use SilverStripe\Security\PasswordValidator;

// Define Application Constants:

if (!defined('APP_DIR')) {
Expand All @@ -24,3 +27,10 @@
if (!defined('APP_PATH')) {
define('APP_PATH', realpath(__DIR__));
}

// Define Member Password Validator:

$validator = new PasswordValidator();
$validator->setMinLength(8);
$validator->setHistoricCount(6);
Member::set_password_validator($validator);
1 change: 1 addition & 0 deletions app/_config/theme.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ Name: app-theme

SilverStripe\View\SSViewer:
themes:
- '$public'
- 'silverware-theme'
- '$default'
73 changes: 0 additions & 73 deletions app/code/Page.php

This file was deleted.

63 changes: 0 additions & 63 deletions app/code/PageController.php

This file was deleted.

77 changes: 77 additions & 0 deletions app/src/Page.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
<?php

/**
* This file is part of {app-title}.
*
* PHP version >=5.6.0
*
* For full copyright and license information, please view the
* LICENSE.md file that was distributed with this source code.
*
* @package {app-namespace}
* @author {author-name} <{author-email}>
* @copyright {year} {author-company}
* @license {license-link} {license-name}
* @link {project-link}
*/

namespace {

use SilverStripe\CMS\Model\SiteTree;

/**
* An extension of the site tree class for the standard SilverStripe page.
*
* As SilverStripe relies on having a global Page class available, this class is
* intentionally defined without a namespace in order to keep SilverStripe happy.
*
* @package {app-namespace}
* @author {author-name} <{author-email}>
* @copyright {year} {author-company}
* @license {license-link} {license-name}
* @link {project-link}
*/
class Page extends SiteTree
{
/**
* Human-readable singular name.
*
* @var string
* @config
*/
private static $singular_name = 'Page';

/**
* Human-readable plural name.
*
* @var string
* @config
*/
private static $plural_name = 'Pages';

/**
* Description of this object.
*
* @var string
* @config
*/
private static $description = 'Standard content page';

/**
* Icon file for this page type.
*
* @var string
* @config
*/
private static $icon = 'app/admin/client/dist/images/icons/Page.png';

/**
* Defines the table name to use for this object.
*
* @var string
* @config
*/
private static $table_name = 'Page';
}

}
Loading

0 comments on commit d4cdc49

Please sign in to comment.