various bugfixes
This commit is contained in:
@ -16,11 +16,19 @@ namespace TheTempusProject\Classes;
|
||||
|
||||
use TheTempusProject\Bedrock\Functions\Check;
|
||||
use TheTempusProject\Canary\Bin\Canary as Debug;
|
||||
use TheTempusProject\Bedrock\Functions\Input;
|
||||
use TheTempusProject\Models\User;
|
||||
use TheTempusProject\Classes\Forms;
|
||||
use TheTempusProject\Bedrock\Classes\Database;
|
||||
|
||||
class Forms extends Check {
|
||||
private static $formHandlers = [];
|
||||
private static $initialized = false;
|
||||
|
||||
public static function check( $formName ) {
|
||||
if ( self::$initialized !== true ) {
|
||||
self::initHandlers();
|
||||
}
|
||||
if ( empty( self::$formHandlers[ $formName ] ) ) {
|
||||
Debug::error( "Form not found: $formName" );
|
||||
return false;
|
||||
@ -74,4 +82,530 @@ class Forms extends Check {
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds these functions to the form list.
|
||||
*/
|
||||
public function __construct() {
|
||||
if ( self::$initialized === true ) {
|
||||
return;
|
||||
}
|
||||
self::initHandlers();
|
||||
}
|
||||
|
||||
private static function initHandlers() {
|
||||
self::addHandler( 'passwordResetCode', __CLASS__, 'passwordResetCode' );
|
||||
self::addHandler( 'createRoute', __CLASS__, 'createRoute' );
|
||||
self::addHandler( 'editRoute', __CLASS__, 'editRoute' );
|
||||
self::addHandler( 'register', __CLASS__, 'register' );
|
||||
self::addHandler( 'createUser', __CLASS__, 'createUser' );
|
||||
self::addHandler( 'editUser', __CLASS__, 'editUser' );
|
||||
self::addHandler( 'login', __CLASS__, 'login' );
|
||||
self::addHandler( 'changeEmail', __CLASS__, 'changeEmail' );
|
||||
self::addHandler( 'changePassword', __CLASS__, 'changePassword' );
|
||||
self::addHandler( 'passwordReset', __CLASS__, 'passwordReset' );
|
||||
self::addHandler( 'emailConfirmation', __CLASS__, 'emailConfirmation' );
|
||||
self::addHandler( 'confirmationResend', __CLASS__, 'confirmationResend' );
|
||||
self::addHandler( 'replyMessage', __CLASS__, 'replyMessage' );
|
||||
self::addHandler( 'newMessage', __CLASS__, 'newMessage' );
|
||||
self::addHandler( 'userPrefs', __CLASS__, 'userPrefs' );
|
||||
self::addHandler( 'newGroup', __CLASS__, 'newGroup' );
|
||||
self::addHandler( 'editGroup', __CLASS__, 'editGroup' );
|
||||
self::addHandler( 'install', __CLASS__, 'install' );
|
||||
self::addHandler( 'installStart', __CLASS__, 'install', [ 'start' ] );
|
||||
self::addHandler( 'installAgreement', __CLASS__, 'install', [ 'agreement' ] );
|
||||
self::addHandler( 'installCheck', __CLASS__, 'install', [ 'check' ] );
|
||||
self::addHandler( 'installConfigure', __CLASS__, 'install', [ 'configure' ] );
|
||||
self::addHandler( 'installRouting', __CLASS__, 'install', [ 'routing' ] );
|
||||
self::addHandler( 'installModels', __CLASS__, 'install', [ 'models' ] );
|
||||
self::addHandler( 'installPlugins', __CLASS__, 'install', [ 'plugins' ] );
|
||||
self::addHandler( 'installResources', __CLASS__, 'install', [ 'resources' ] );
|
||||
self::addHandler( 'installAdminUser', __CLASS__, 'install', [ 'adminUser' ] );
|
||||
self::$initialized = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates the installer forms.
|
||||
*
|
||||
* @return {bool}
|
||||
*/
|
||||
public static function install( $page = '' ) {
|
||||
// if ( !self::token() ) {
|
||||
// return false;
|
||||
// }
|
||||
switch ( $page ) {
|
||||
case 'configure':
|
||||
if ( ! Input::exists( 'submit' ) ) {
|
||||
return false;
|
||||
}
|
||||
if ( !Database::check( Input::post( 'dbHost' ), Input::post( 'dbName' ), Input::post( 'dbUsername' ), Input::post( 'dbPassword' ) ) ) {
|
||||
self::addUserError( 'DB connection error.' );
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
case 'adminUser':
|
||||
if ( !self::checkUsername( Input::post( 'newUsername' ) ) ) {
|
||||
self::addUserError( 'Invalid username.' );
|
||||
return false;
|
||||
}
|
||||
if ( !self::password( Input::post( 'userPassword' ) ) ) {
|
||||
self::addUserError( 'Invalid password.' );
|
||||
return false;
|
||||
}
|
||||
if ( Input::post( 'userPassword' ) !== Input::post( 'userPassword2' ) ) {
|
||||
self::addUserError( 'Passwords do not match.' );
|
||||
return false;
|
||||
}
|
||||
if ( Input::post( 'userEmail' ) !== Input::post( 'userEmail2' ) ) {
|
||||
self::addUserError( 'Emails do not match.' );
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
case 'check':
|
||||
if ( !self::uploads() ) {
|
||||
self::addUserError( 'Uploads are disabled.' );
|
||||
return false;
|
||||
}
|
||||
if ( !self::php() ) {
|
||||
self::addUserError( 'PHP version is too old.' );
|
||||
return false;
|
||||
}
|
||||
if ( !self::phpExtensions() ) {
|
||||
self::addUserError( 'PHP extensions are missing.' );
|
||||
return false;
|
||||
}
|
||||
if ( !self::sessions() ) {
|
||||
self::addUserError( 'There is an error with Sessions.' );
|
||||
return false;
|
||||
}
|
||||
if ( !self::mail() ) {
|
||||
self::addUserError( 'PHP mail is not enabled.' );
|
||||
return false;
|
||||
}
|
||||
if ( !self::safe() ) {
|
||||
self::addUserError( 'Safe mode is enabled.' );
|
||||
return false;
|
||||
}
|
||||
if ( ! Input::exists( 'submit' ) ) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
case 'start':
|
||||
case 'agreement':
|
||||
case 'routing':
|
||||
case 'models':
|
||||
case 'plugins':
|
||||
case 'resources':
|
||||
if ( ! Input::exists( 'submit' ) ) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates the password re-send form.
|
||||
*
|
||||
* @return {bool}
|
||||
*/
|
||||
public static function passwordResetCode() {
|
||||
if ( !self::token() ) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates the route creation form.
|
||||
*
|
||||
* @return {bool}
|
||||
*/
|
||||
public static function createRoute() {
|
||||
if ( !Input::exists( 'redirect_type' ) ) {
|
||||
return false;
|
||||
}
|
||||
if ( 'external' == Input::post( 'redirect_type' ) && !self::url( Input::post( 'forwarded_url' ) ) ) {
|
||||
return false;
|
||||
}
|
||||
if ( !self::token() ) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates the route edit form.
|
||||
*
|
||||
* @return {bool}
|
||||
*/
|
||||
public static function editRoute() {
|
||||
if ( !Input::exists( 'redirect_type' ) ) {
|
||||
return false;
|
||||
}
|
||||
if ( 'external' == Input::post( 'redirect_type' ) && !self::url( Input::post( 'forwarded_url' ) ) ) {
|
||||
return false;
|
||||
}
|
||||
if ( !self::token() ) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates the user creation form.
|
||||
*
|
||||
* @return {bool}
|
||||
*/
|
||||
public static function createUser() {
|
||||
$user = new User;
|
||||
if ( !$user->checkUsername( Input::post( 'username' ) ) ) {
|
||||
self::addUserError( 'Invalid username.' );
|
||||
return false;
|
||||
}
|
||||
if ( !self::password( Input::post( 'password' ) ) ) {
|
||||
self::addUserError( 'Invalid password.' );
|
||||
return false;
|
||||
}
|
||||
if ( !self::email( Input::post( 'email' ) ) ) {
|
||||
self::addUserError( 'Invalid Email.' );
|
||||
return false;
|
||||
}
|
||||
if ( !$user->noEmailExists( Input::post( 'email' ) ) ) {
|
||||
self::addUserError( 'A user with that email is already registered.' );
|
||||
return false;
|
||||
}
|
||||
if ( Input::post( 'password' ) !== Input::post( 'password2' ) ) {
|
||||
self::addUserError( 'Passwords do not match.' );
|
||||
return false;
|
||||
}
|
||||
if ( Input::post( 'email' ) !== Input::post( 'email2' ) ) {
|
||||
self::addUserError( 'Emails do not match.' );
|
||||
return false;
|
||||
}
|
||||
if ( !Input::post( 'groupSelect' ) ) {
|
||||
self::addUserError( 'You must select a group for the new user.' );
|
||||
return false;
|
||||
}
|
||||
if ( !self::token() ) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates the user edit form.
|
||||
*
|
||||
* @return {bool}
|
||||
*/
|
||||
public static function editUser() {
|
||||
$user = new User;
|
||||
if ( !$user->checkUsername( Input::post( 'username' ) ) ) {
|
||||
self::addUserError( 'Invalid username.' );
|
||||
return false;
|
||||
}
|
||||
if ( Input::exists( 'password' ) ) {
|
||||
if ( !self::password( Input::post( 'password' ) ) ) {
|
||||
self::addUserError( 'Invalid password.' );
|
||||
return false;
|
||||
}
|
||||
if ( Input::post( 'password' ) !== Input::post( 'password2' ) ) {
|
||||
self::addUserError( 'Passwords do not match.' );
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if ( !self::email( Input::post( 'email' ) ) ) {
|
||||
self::addUserError( 'Invalid Email.' );
|
||||
return false;
|
||||
}
|
||||
if ( !Input::post( 'groupSelect' ) ) {
|
||||
self::addUserError( 'You must select a group for the new user.' );
|
||||
return false;
|
||||
}
|
||||
if ( !self::token() ) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates the user registration form.
|
||||
*
|
||||
* @return {bool}
|
||||
*/
|
||||
public static function register() {
|
||||
$user = new User;
|
||||
if ( !self::checkUsername( Input::post( 'username' ) ) ) {
|
||||
self::addUserError( 'Invalid username.' );
|
||||
return false;
|
||||
}
|
||||
if ( !self::password( Input::post( 'password' ) ) ) {
|
||||
self::addUserError( 'Invalid password.' );
|
||||
return false;
|
||||
}
|
||||
if ( !self::email( Input::post( 'email' ) ) ) {
|
||||
self::addUserError( 'Invalid Email.' );
|
||||
return false;
|
||||
}
|
||||
if ( !$user->noEmailExists( Input::post( 'email' ) ) ) {
|
||||
self::addUserError( 'A user with that email is already registered.' );
|
||||
return false;
|
||||
}
|
||||
if ( Input::post( 'password' ) !== Input::post( 'password2' ) ) {
|
||||
self::addUserError( 'Passwords do not match.' );
|
||||
return false;
|
||||
}
|
||||
if ( Input::post( 'email' ) !== Input::post( 'email2' ) ) {
|
||||
self::addUserError( 'Emails do not match.' );
|
||||
return false;
|
||||
}
|
||||
if ( Input::post( 'terms' ) != '1' ) {
|
||||
self::addUserError( 'You must agree to the terms of service.' );
|
||||
return false;
|
||||
}
|
||||
if ( !self::token() ) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates the user login form.
|
||||
*
|
||||
* @return {bool}
|
||||
*/
|
||||
public static function login() {
|
||||
if ( !self::checkUsername( Input::post( 'username' ) ) ) {
|
||||
self::addUserError( 'Invalid username.' );
|
||||
return false;
|
||||
}
|
||||
if ( !self::password( Input::post( 'password' ) ) ) {
|
||||
self::addUserError( 'Invalid password.' );
|
||||
return false;
|
||||
}
|
||||
if ( !self::token() ) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates the email change form.
|
||||
*
|
||||
* @return {bool}
|
||||
*/
|
||||
public static function changeEmail() {
|
||||
if ( !self::email( Input::post( 'email' ) ) ) {
|
||||
self::addUserError( 'Invalid Email.' );
|
||||
return false;
|
||||
}
|
||||
if ( Input::post( 'email' ) !== Input::post( 'email2' ) ) {
|
||||
self::addUserError( 'Emails do not match.' );
|
||||
return false;
|
||||
}
|
||||
if ( !self::token() ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates the password change form.
|
||||
*
|
||||
* @return {bool}
|
||||
*/
|
||||
public static function changePassword() {
|
||||
if ( !self::password( Input::post( 'password' ) ) ) {
|
||||
self::addUserError( 'Invalid password.' );
|
||||
return false;
|
||||
}
|
||||
if ( Input::post( 'password' ) !== Input::post( 'password2' ) ) {
|
||||
self::addUserError( 'Passwords do not match.' );
|
||||
return false;
|
||||
}
|
||||
if ( !self::token() ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates the password reset form.
|
||||
*
|
||||
* @return {bool}
|
||||
*/
|
||||
public static function passwordReset() {
|
||||
if ( !self::password( Input::post( 'password' ) ) ) {
|
||||
self::addUserError( 'Invalid password.' );
|
||||
return false;
|
||||
}
|
||||
if ( Input::post( 'password' ) !== Input::post( 'password2' ) ) {
|
||||
self::addUserError( 'Passwords do not match.' );
|
||||
return false;
|
||||
}
|
||||
if ( !self::token() ) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates the email confirmation re-send form.
|
||||
*
|
||||
* @return {bool}
|
||||
*/
|
||||
public static function emailConfirmation() {
|
||||
if ( !Input::exists( 'confirmationCode' ) ) {
|
||||
self::addUserError( 'No confirmation code provided.' );
|
||||
return false;
|
||||
}
|
||||
if ( !self::token() ) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates the email confirmation re-send form.
|
||||
*
|
||||
* @return {bool}
|
||||
*/
|
||||
public static function confirmationResend() {
|
||||
if ( !Input::exists( 'resendConfirmation' ) ) {
|
||||
self::addUserError( 'Confirmation not provided.' );
|
||||
return false;
|
||||
}
|
||||
if ( !self::token() ) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates the reply message form.
|
||||
*
|
||||
* @return {bool}
|
||||
*/
|
||||
public static function replyMessage() {
|
||||
if ( !Input::exists( 'message' ) ) {
|
||||
self::addUserError( 'Reply cannot be empty.' );
|
||||
return false;
|
||||
}
|
||||
if ( !Input::exists( 'messageID' ) ) {
|
||||
return false;
|
||||
}
|
||||
if ( !self::token() ) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates the new message form.
|
||||
*
|
||||
* @return {bool}
|
||||
*/
|
||||
public static function newMessage() {
|
||||
if ( !Input::exists( 'toUser' ) ) {
|
||||
self::addUserError( 'You must specify a user to send the message to.' );
|
||||
return false;
|
||||
}
|
||||
if ( !Input::exists( 'subject' ) ) {
|
||||
self::addUserError( 'You must have a subject for your message.' );
|
||||
return false;
|
||||
}
|
||||
if ( !Input::exists( 'message' ) ) {
|
||||
self::addUserError( 'No message entered.' );
|
||||
return false;
|
||||
}
|
||||
if ( !self::token() ) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates the user preferences form.
|
||||
*
|
||||
* @return {bool}
|
||||
*/
|
||||
public static function userPrefs() {
|
||||
// @todo make this a real check
|
||||
if ( !Input::exists( 'timeFormat' ) ) {
|
||||
self::addUserError( 'You must specify timeFormat' );
|
||||
return false;
|
||||
}
|
||||
if ( !Input::exists( 'pageLimit' ) ) {
|
||||
self::addUserError( 'You must specify pageLimit' );
|
||||
return false;
|
||||
}
|
||||
if ( !Input::exists( 'gender' ) ) {
|
||||
self::addUserError( 'You must specify gender' );
|
||||
return false;
|
||||
}
|
||||
if ( !Input::exists( 'dateFormat' ) ) {
|
||||
self::addUserError( 'You must specify dateFormat' );
|
||||
return false;
|
||||
}
|
||||
if ( !Input::exists( 'timezone' ) ) {
|
||||
self::addUserError( 'You must specify timezone' );
|
||||
return false;
|
||||
}
|
||||
if ( !Input::exists( 'updates' ) ) {
|
||||
self::addUserError( 'You must specify updates' );
|
||||
return false;
|
||||
}
|
||||
if ( !Input::exists( 'newsletter' ) ) {
|
||||
self::addUserError( 'You must specify newsletter' );
|
||||
return false;
|
||||
}
|
||||
if ( !self::token() ) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates the group creation form.
|
||||
*
|
||||
* @return {bool}
|
||||
*/
|
||||
public static function newGroup() {
|
||||
if ( !Input::exists( 'name' ) ) {
|
||||
self::addUserError( 'You must specify a name' );
|
||||
return false;
|
||||
}
|
||||
if ( !self::dataTitle( Input::exists( 'name' ) ) ) {
|
||||
self::addUserError( 'invalid group name' );
|
||||
return false;
|
||||
}
|
||||
if ( !self::token() ) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates the group edit form.
|
||||
*
|
||||
* @return {bool}
|
||||
*/
|
||||
public static function editGroup() {
|
||||
if ( !Input::exists( 'name' ) ) {
|
||||
self::addUserError( 'You must specify a name' );
|
||||
return false;
|
||||
}
|
||||
if ( !self::dataTitle( Input::exists( 'name' ) ) ) {
|
||||
self::addUserError( 'invalid group name' );
|
||||
return false;
|
||||
}
|
||||
if ( !self::token() ) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -43,6 +43,8 @@ if ( ! defined( 'CONFIG_DIRECTORY' ) ) {
|
||||
// Cookies
|
||||
define( 'DEFAULT_COOKIE_PREFIX', 'TP_');
|
||||
// Debug
|
||||
|
||||
define( 'CANARY_DEBUG_DIRECTORY', APP_ROOT_DIRECTORY . 'logs' . DIRECTORY_SEPARATOR );
|
||||
define( 'CANARY_DEBUG_LEVEL_ERROR', 'error' );
|
||||
define( 'CANARY_DEBUG_LEVEL_WARN', 'warn' );
|
||||
define( 'CANARY_DEBUG_LEVEL_INFO', 'info' );
|
||||
|
@ -59,6 +59,6 @@ class Composer extends AdminController {
|
||||
$out[] = (object) $versionsInstalled[ $name ];
|
||||
}
|
||||
|
||||
Views::view( 'admin.dependencies', $out );
|
||||
Views::view( 'admin.modules.composer.dependencies', $out );
|
||||
}
|
||||
}
|
||||
|
@ -11,7 +11,7 @@
|
||||
*/
|
||||
namespace TheTempusProject\Controllers\Admin;
|
||||
|
||||
use TheTempusProject\TTPForms;
|
||||
use TheTempusProject\Classes\Forms as TTPForms;
|
||||
use TheTempusProject\Houdini\Classes\Views;
|
||||
use TheTempusProject\Houdini\Classes\Issues;
|
||||
use TheTempusProject\Houdini\Classes\Navigation;
|
||||
|
@ -1,542 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* app/functions/forms.php
|
||||
*
|
||||
* This class is used in conjunction with TheTempusProject\Bedrock\Classes\Check
|
||||
* to house complete form verification. You can utilize the error reporting
|
||||
* to easily define exactly what feedback you would like to give.
|
||||
*
|
||||
* @version 3.0
|
||||
* @author Joey Kimsey <Joey@thetempusproject.com>
|
||||
* @link https://TheTempusProject.com
|
||||
* @license https://opensource.org/licenses/MIT [MIT LICENSE]
|
||||
*/
|
||||
namespace TheTempusProject;
|
||||
|
||||
use TheTempusProject\Bedrock\Functions\Input;
|
||||
use TheTempusProject\Bedrock\Functions\Check;
|
||||
use TheTempusProject\Models\User;
|
||||
use TheTempusProject\Classes\Forms;
|
||||
use TheTempusProject\Bedrock\Classes\Database;
|
||||
|
||||
class TTPForms extends Forms {
|
||||
/**
|
||||
* Adds these functions to the form list.
|
||||
*/
|
||||
public function __construct() {
|
||||
self::addHandler( 'passwordResetCode', __CLASS__, 'passwordResetCode' );
|
||||
self::addHandler( 'createRoute', __CLASS__, 'createRoute' );
|
||||
self::addHandler( 'editRoute', __CLASS__, 'editRoute' );
|
||||
self::addHandler( 'register', __CLASS__, 'register' );
|
||||
self::addHandler( 'createUser', __CLASS__, 'createUser' );
|
||||
self::addHandler( 'editUser', __CLASS__, 'editUser' );
|
||||
self::addHandler( 'login', __CLASS__, 'login' );
|
||||
self::addHandler( 'changeEmail', __CLASS__, 'changeEmail' );
|
||||
self::addHandler( 'changePassword', __CLASS__, 'changePassword' );
|
||||
self::addHandler( 'passwordReset', __CLASS__, 'passwordReset' );
|
||||
self::addHandler( 'emailConfirmation', __CLASS__, 'emailConfirmation' );
|
||||
self::addHandler( 'confirmationResend', __CLASS__, 'confirmationResend' );
|
||||
self::addHandler( 'replyMessage', __CLASS__, 'replyMessage' );
|
||||
self::addHandler( 'newMessage', __CLASS__, 'newMessage' );
|
||||
self::addHandler( 'userPrefs', __CLASS__, 'userPrefs' );
|
||||
self::addHandler( 'newGroup', __CLASS__, 'newGroup' );
|
||||
self::addHandler( 'editGroup', __CLASS__, 'editGroup' );
|
||||
self::addHandler( 'install', __CLASS__, 'install' );
|
||||
self::addHandler( 'installStart', __CLASS__, 'install', [ 'start' ] );
|
||||
self::addHandler( 'installAgreement', __CLASS__, 'install', [ 'agreement' ] );
|
||||
self::addHandler( 'installCheck', __CLASS__, 'install', [ 'check' ] );
|
||||
self::addHandler( 'installConfigure', __CLASS__, 'install', [ 'configure' ] );
|
||||
self::addHandler( 'installRouting', __CLASS__, 'install', [ 'routing' ] );
|
||||
self::addHandler( 'installModels', __CLASS__, 'install', [ 'models' ] );
|
||||
self::addHandler( 'installPlugins', __CLASS__, 'install', [ 'plugins' ] );
|
||||
self::addHandler( 'installResources', __CLASS__, 'install', [ 'resources' ] );
|
||||
self::addHandler( 'installAdminUser', __CLASS__, 'install', [ 'adminUser' ] );
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates the installer forms.
|
||||
*
|
||||
* @return {bool}
|
||||
*/
|
||||
public static function install( $page = '' ) {
|
||||
// if ( !self::token() ) {
|
||||
// return false;
|
||||
// }
|
||||
switch ( $page ) {
|
||||
case 'configure':
|
||||
if ( ! Input::exists( 'submit' ) ) {
|
||||
return false;
|
||||
}
|
||||
if ( !Database::check( Input::post( 'dbHost' ), Input::post( 'dbName' ), Input::post( 'dbUsername' ), Input::post( 'dbPassword' ) ) ) {
|
||||
self::addUserError( 'DB connection error.' );
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
case 'adminUser':
|
||||
if ( !self::checkUsername( Input::post( 'newUsername' ) ) ) {
|
||||
self::addUserError( 'Invalid username.' );
|
||||
return false;
|
||||
}
|
||||
if ( !self::password( Input::post( 'userPassword' ) ) ) {
|
||||
self::addUserError( 'Invalid password.' );
|
||||
return false;
|
||||
}
|
||||
if ( Input::post( 'userPassword' ) !== Input::post( 'userPassword2' ) ) {
|
||||
self::addUserError( 'Passwords do not match.' );
|
||||
return false;
|
||||
}
|
||||
if ( Input::post( 'userEmail' ) !== Input::post( 'userEmail2' ) ) {
|
||||
self::addUserError( 'Emails do not match.' );
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
case 'check':
|
||||
if ( !self::uploads() ) {
|
||||
self::addUserError( 'Uploads are disabled.' );
|
||||
return false;
|
||||
}
|
||||
if ( !self::php() ) {
|
||||
self::addUserError( 'PHP version is too old.' );
|
||||
return false;
|
||||
}
|
||||
if ( !self::phpExtensions() ) {
|
||||
self::addUserError( 'PHP extensions are missing.' );
|
||||
return false;
|
||||
}
|
||||
if ( !self::sessions() ) {
|
||||
self::addUserError( 'There is an error with Sessions.' );
|
||||
return false;
|
||||
}
|
||||
if ( !self::mail() ) {
|
||||
self::addUserError( 'PHP mail is not enabled.' );
|
||||
return false;
|
||||
}
|
||||
if ( !self::safe() ) {
|
||||
self::addUserError( 'Safe mode is enabled.' );
|
||||
return false;
|
||||
}
|
||||
if ( ! Input::exists( 'submit' ) ) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
case 'start':
|
||||
case 'agreement':
|
||||
case 'routing':
|
||||
case 'models':
|
||||
case 'plugins':
|
||||
case 'resources':
|
||||
if ( ! Input::exists( 'submit' ) ) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates the password re-send form.
|
||||
*
|
||||
* @return {bool}
|
||||
*/
|
||||
public static function passwordResetCode() {
|
||||
if ( !self::token() ) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates the route creation form.
|
||||
*
|
||||
* @return {bool}
|
||||
*/
|
||||
public static function createRoute() {
|
||||
if ( !Input::exists( 'redirect_type' ) ) {
|
||||
return false;
|
||||
}
|
||||
if ( 'external' == Input::post( 'redirect_type' ) && !self::url( Input::post( 'forwarded_url' ) ) ) {
|
||||
return false;
|
||||
}
|
||||
if ( !self::token() ) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates the route edit form.
|
||||
*
|
||||
* @return {bool}
|
||||
*/
|
||||
public static function editRoute() {
|
||||
if ( !Input::exists( 'redirect_type' ) ) {
|
||||
return false;
|
||||
}
|
||||
if ( 'external' == Input::post( 'redirect_type' ) && !self::url( Input::post( 'forwarded_url' ) ) ) {
|
||||
return false;
|
||||
}
|
||||
if ( !self::token() ) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates the user creation form.
|
||||
*
|
||||
* @return {bool}
|
||||
*/
|
||||
public static function createUser() {
|
||||
$user = new User;
|
||||
if ( !$user->checkUsername( Input::post( 'username' ) ) ) {
|
||||
self::addUserError( 'Invalid username.' );
|
||||
return false;
|
||||
}
|
||||
if ( !self::password( Input::post( 'password' ) ) ) {
|
||||
self::addUserError( 'Invalid password.' );
|
||||
return false;
|
||||
}
|
||||
if ( !self::email( Input::post( 'email' ) ) ) {
|
||||
self::addUserError( 'Invalid Email.' );
|
||||
return false;
|
||||
}
|
||||
if ( !$user->noEmailExists( Input::post( 'email' ) ) ) {
|
||||
self::addUserError( 'A user with that email is already registered.' );
|
||||
return false;
|
||||
}
|
||||
if ( Input::post( 'password' ) !== Input::post( 'password2' ) ) {
|
||||
self::addUserError( 'Passwords do not match.' );
|
||||
return false;
|
||||
}
|
||||
if ( Input::post( 'email' ) !== Input::post( 'email2' ) ) {
|
||||
self::addUserError( 'Emails do not match.' );
|
||||
return false;
|
||||
}
|
||||
if ( !Input::post( 'groupSelect' ) ) {
|
||||
self::addUserError( 'You must select a group for the new user.' );
|
||||
return false;
|
||||
}
|
||||
if ( !self::token() ) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates the user edit form.
|
||||
*
|
||||
* @return {bool}
|
||||
*/
|
||||
public static function editUser() {
|
||||
$user = new User;
|
||||
if ( !$user->checkUsername( Input::post( 'username' ) ) ) {
|
||||
self::addUserError( 'Invalid username.' );
|
||||
return false;
|
||||
}
|
||||
if ( Input::exists( 'password' ) ) {
|
||||
if ( !self::password( Input::post( 'password' ) ) ) {
|
||||
self::addUserError( 'Invalid password.' );
|
||||
return false;
|
||||
}
|
||||
if ( Input::post( 'password' ) !== Input::post( 'password2' ) ) {
|
||||
self::addUserError( 'Passwords do not match.' );
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if ( !self::email( Input::post( 'email' ) ) ) {
|
||||
self::addUserError( 'Invalid Email.' );
|
||||
return false;
|
||||
}
|
||||
if ( !Input::post( 'groupSelect' ) ) {
|
||||
self::addUserError( 'You must select a group for the new user.' );
|
||||
return false;
|
||||
}
|
||||
if ( !self::token() ) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates the user registration form.
|
||||
*
|
||||
* @return {bool}
|
||||
*/
|
||||
public static function register() {
|
||||
$user = new User;
|
||||
if ( !self::checkUsername( Input::post( 'username' ) ) ) {
|
||||
self::addUserError( 'Invalid username.' );
|
||||
return false;
|
||||
}
|
||||
if ( !self::password( Input::post( 'password' ) ) ) {
|
||||
self::addUserError( 'Invalid password.' );
|
||||
return false;
|
||||
}
|
||||
if ( !self::email( Input::post( 'email' ) ) ) {
|
||||
self::addUserError( 'Invalid Email.' );
|
||||
return false;
|
||||
}
|
||||
if ( !$user->noEmailExists( Input::post( 'email' ) ) ) {
|
||||
self::addUserError( 'A user with that email is already registered.' );
|
||||
return false;
|
||||
}
|
||||
if ( Input::post( 'password' ) !== Input::post( 'password2' ) ) {
|
||||
self::addUserError( 'Passwords do not match.' );
|
||||
return false;
|
||||
}
|
||||
if ( Input::post( 'email' ) !== Input::post( 'email2' ) ) {
|
||||
self::addUserError( 'Emails do not match.' );
|
||||
return false;
|
||||
}
|
||||
if ( Input::post( 'terms' ) != '1' ) {
|
||||
self::addUserError( 'You must agree to the terms of service.' );
|
||||
return false;
|
||||
}
|
||||
if ( !self::token() ) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates the user login form.
|
||||
*
|
||||
* @return {bool}
|
||||
*/
|
||||
public static function login() {
|
||||
if ( !self::checkUsername( Input::post( 'username' ) ) ) {
|
||||
self::addUserError( 'Invalid username.' );
|
||||
return false;
|
||||
}
|
||||
if ( !self::password( Input::post( 'password' ) ) ) {
|
||||
self::addUserError( 'Invalid password.' );
|
||||
return false;
|
||||
}
|
||||
if ( !self::token() ) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates the email change form.
|
||||
*
|
||||
* @return {bool}
|
||||
*/
|
||||
public static function changeEmail() {
|
||||
if ( !self::email( Input::post( 'email' ) ) ) {
|
||||
self::addUserError( 'Invalid Email.' );
|
||||
return false;
|
||||
}
|
||||
if ( Input::post( 'email' ) !== Input::post( 'email2' ) ) {
|
||||
self::addUserError( 'Emails do not match.' );
|
||||
return false;
|
||||
}
|
||||
if ( !self::token() ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates the password change form.
|
||||
*
|
||||
* @return {bool}
|
||||
*/
|
||||
public static function changePassword() {
|
||||
if ( !self::password( Input::post( 'password' ) ) ) {
|
||||
self::addUserError( 'Invalid password.' );
|
||||
return false;
|
||||
}
|
||||
if ( Input::post( 'password' ) !== Input::post( 'password2' ) ) {
|
||||
self::addUserError( 'Passwords do not match.' );
|
||||
return false;
|
||||
}
|
||||
if ( !self::token() ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates the password reset form.
|
||||
*
|
||||
* @return {bool}
|
||||
*/
|
||||
public static function passwordReset() {
|
||||
if ( !self::password( Input::post( 'password' ) ) ) {
|
||||
self::addUserError( 'Invalid password.' );
|
||||
return false;
|
||||
}
|
||||
if ( Input::post( 'password' ) !== Input::post( 'password2' ) ) {
|
||||
self::addUserError( 'Passwords do not match.' );
|
||||
return false;
|
||||
}
|
||||
if ( !self::token() ) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates the email confirmation re-send form.
|
||||
*
|
||||
* @return {bool}
|
||||
*/
|
||||
public static function emailConfirmation() {
|
||||
if ( !Input::exists( 'confirmationCode' ) ) {
|
||||
self::addUserError( 'No confirmation code provided.' );
|
||||
return false;
|
||||
}
|
||||
if ( !self::token() ) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates the email confirmation re-send form.
|
||||
*
|
||||
* @return {bool}
|
||||
*/
|
||||
public static function confirmationResend() {
|
||||
if ( !Input::exists( 'resendConfirmation' ) ) {
|
||||
self::addUserError( 'Confirmation not provided.' );
|
||||
return false;
|
||||
}
|
||||
if ( !self::token() ) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates the reply message form.
|
||||
*
|
||||
* @return {bool}
|
||||
*/
|
||||
public static function replyMessage() {
|
||||
if ( !Input::exists( 'message' ) ) {
|
||||
self::addUserError( 'Reply cannot be empty.' );
|
||||
return false;
|
||||
}
|
||||
if ( !Input::exists( 'messageID' ) ) {
|
||||
return false;
|
||||
}
|
||||
if ( !self::token() ) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates the new message form.
|
||||
*
|
||||
* @return {bool}
|
||||
*/
|
||||
public static function newMessage() {
|
||||
if ( !Input::exists( 'toUser' ) ) {
|
||||
self::addUserError( 'You must specify a user to send the message to.' );
|
||||
return false;
|
||||
}
|
||||
if ( !Input::exists( 'subject' ) ) {
|
||||
self::addUserError( 'You must have a subject for your message.' );
|
||||
return false;
|
||||
}
|
||||
if ( !Input::exists( 'message' ) ) {
|
||||
self::addUserError( 'No message entered.' );
|
||||
return false;
|
||||
}
|
||||
if ( !self::token() ) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates the user preferences form.
|
||||
*
|
||||
* @return {bool}
|
||||
*/
|
||||
public static function userPrefs() {
|
||||
// @todo make this a real check
|
||||
if ( !Input::exists( 'timeFormat' ) ) {
|
||||
self::addUserError( 'You must specify timeFormat' );
|
||||
return false;
|
||||
}
|
||||
if ( !Input::exists( 'pageLimit' ) ) {
|
||||
self::addUserError( 'You must specify pageLimit' );
|
||||
return false;
|
||||
}
|
||||
if ( !Input::exists( 'gender' ) ) {
|
||||
self::addUserError( 'You must specify gender' );
|
||||
return false;
|
||||
}
|
||||
if ( !Input::exists( 'dateFormat' ) ) {
|
||||
self::addUserError( 'You must specify dateFormat' );
|
||||
return false;
|
||||
}
|
||||
if ( !Input::exists( 'timezone' ) ) {
|
||||
self::addUserError( 'You must specify timezone' );
|
||||
return false;
|
||||
}
|
||||
if ( !Input::exists( 'updates' ) ) {
|
||||
self::addUserError( 'You must specify updates' );
|
||||
return false;
|
||||
}
|
||||
if ( !Input::exists( 'newsletter' ) ) {
|
||||
self::addUserError( 'You must specify newsletter' );
|
||||
return false;
|
||||
}
|
||||
if ( !self::token() ) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates the group creation form.
|
||||
*
|
||||
* @return {bool}
|
||||
*/
|
||||
public static function newGroup() {
|
||||
if ( !Input::exists( 'name' ) ) {
|
||||
self::addUserError( 'You must specify a name' );
|
||||
return false;
|
||||
}
|
||||
if ( !self::dataTitle( Input::exists( 'name' ) ) ) {
|
||||
self::addUserError( 'invalid group name' );
|
||||
return false;
|
||||
}
|
||||
if ( !self::token() ) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates the group edit form.
|
||||
*
|
||||
* @return {bool}
|
||||
*/
|
||||
public static function editGroup() {
|
||||
if ( !Input::exists( 'name' ) ) {
|
||||
self::addUserError( 'You must specify a name' );
|
||||
return false;
|
||||
}
|
||||
if ( !self::dataTitle( Input::exists( 'name' ) ) ) {
|
||||
self::addUserError( 'invalid group name' );
|
||||
return false;
|
||||
}
|
||||
if ( !self::token() ) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
new TTPForms;
|
@ -13,7 +13,7 @@ namespace TheTempusProject\Models;
|
||||
|
||||
use TheTempusProject\Bedrock\Functions\Check;
|
||||
use TheTempusProject\Bedrock\Classes\Config;
|
||||
use TheTempusProject\Bedrock\Classes\CustomException;
|
||||
use TheTempusProject\Canary\Classes\CustomException;
|
||||
use TheTempusProject\TheTempusProject as App;
|
||||
use TheTempusProject\Classes\DatabaseModel;
|
||||
use TheTempusProject\Canary\Bin\Canary as Debug;
|
||||
|
@ -21,7 +21,7 @@ use TheTempusProject\Bedrock\Functions\Hash;
|
||||
use TheTempusProject\Bedrock\Functions\Session;
|
||||
use TheTempusProject\Bedrock\Functions\Code;
|
||||
use TheTempusProject\Bedrock\Classes\Config;
|
||||
use TheTempusProject\Bedrock\Classes\CustomException;
|
||||
use TheTempusProject\Canary\Classes\CustomException;
|
||||
use TheTempusProject\Classes\Email;
|
||||
use TheTempusProject\Classes\DatabaseModel;
|
||||
use TheTempusProject\Classes\Preferences;
|
||||
|
@ -17,7 +17,7 @@ use TheTempusProject\Bedrock\Functions\Check;
|
||||
use TheTempusProject\Bedrock\Functions\Sanitize;
|
||||
use TheTempusProject\Classes\DatabaseModel;
|
||||
use TheTempusProject\TheTempusProject as App;
|
||||
use TheTempusProject\Bedrock\Classes\CustomException;
|
||||
use TheTempusProject\Canary\Classes\CustomException;
|
||||
use TheTempusProject\Houdini\Classes\Filters;
|
||||
|
||||
class Posts extends DatabaseModel {
|
||||
|
@ -15,7 +15,7 @@ namespace TheTempusProject\Models;
|
||||
use TheTempusProject\Bedrock\Functions\Check;
|
||||
use TheTempusProject\Bedrock\Classes\Config;
|
||||
use TheTempusProject\Canary\Bin\Canary as Debug;
|
||||
use TheTempusProject\Bedrock\Classes\CustomException;
|
||||
use TheTempusProject\Canary\Classes\CustomException;
|
||||
use TheTempusProject\Classes\DatabaseModel;
|
||||
use TheTempusProject\Plugins\Bugreport as Plugin;
|
||||
use TheTempusProject\TheTempusProject as App;
|
||||
|
@ -18,7 +18,7 @@ use TheTempusProject\Canary\Bin\Canary as Debug;
|
||||
use TheTempusProject\Houdini\Classes\Views;
|
||||
use TheTempusProject\Classes\DatabaseModel;
|
||||
use TheTempusProject\TheTempusProject as App;
|
||||
use TheTempusProject\Bedrock\Classes\CustomException;
|
||||
use TheTempusProject\Canary\Classes\CustomException;
|
||||
use TheTempusProject\Houdini\Classes\Filters;
|
||||
|
||||
class Comments extends DatabaseModel {
|
||||
|
@ -18,7 +18,7 @@ use TheTempusProject\Canary\Bin\Canary as Debug;
|
||||
use TheTempusProject\Bedrock\Functions\Check;
|
||||
use TheTempusProject\Bedrock\Functions\Sanitize;
|
||||
use TheTempusProject\TheTempusProject as App;
|
||||
use TheTempusProject\Bedrock\Classes\CustomException;
|
||||
use TheTempusProject\Canary\Classes\CustomException;
|
||||
|
||||
class Message extends DatabaseModel {
|
||||
public $tableName = 'messages';
|
||||
|
@ -18,7 +18,7 @@ use TheTempusProject\Canary\Bin\Canary as Debug;
|
||||
use TheTempusProject\Classes\DatabaseModel;
|
||||
use TheTempusProject\TheTempusProject as App;
|
||||
use TheTempusProject\Houdini\Classes\Views;
|
||||
use TheTempusProject\Bedrock\Classes\CustomException;
|
||||
use TheTempusProject\Canary\Classes\CustomException;
|
||||
|
||||
class Notification extends DatabaseModel {
|
||||
public $tableName = 'notifications';
|
||||
|
@ -16,6 +16,8 @@ use ReflectionClass;
|
||||
use TheTempusProject\Classes\Installer;
|
||||
use TheTempusProject\Houdini\Classes\Navigation;
|
||||
use TheTempusProject\Classes\Plugin;
|
||||
use TheTempusProject\Houdini\Classes\Components;
|
||||
use TheTempusProject\Houdini\Classes\Views;
|
||||
use TheTempusProject\TheTempusProject as App;
|
||||
|
||||
class Subscribe extends Plugin {
|
||||
@ -31,4 +33,9 @@ class Subscribe extends Plugin {
|
||||
'url' => '{ROOT_URL}admin/subscriptions',
|
||||
],
|
||||
];
|
||||
|
||||
public function __construct( $load = false ) {
|
||||
parent::__construct( $load );
|
||||
Components::set( 'FOOTER_RIGHT', Views::simpleView( 'subscribe.footer.right') );
|
||||
}
|
||||
}
|
||||
|
15
app/plugins/subscribe/views/footer/right.html
Normal file
15
app/plugins/subscribe/views/footer/right.html
Normal file
@ -0,0 +1,15 @@
|
||||
|
||||
<div class="col-lg-3 text-center">
|
||||
<h3>Subscribe</h3>
|
||||
<ul>
|
||||
<li>
|
||||
<div class="input-append newsletter-box">
|
||||
<form action="{ROOT_URL}subscribe/home" method="post" class="form-horizontal">
|
||||
<input type="email" class="full form-control" placeholder="Email" id="email" name="email" autocomplete="email" style="margin-bottom: 15px;">
|
||||
<input type="hidden" name="token" value="{TOKEN}">
|
||||
<button name="submit" value="submit" type="submit" class="btn btn-lg btn-primary center-block">Subscribe</button>
|
||||
</form>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
@ -31,9 +31,12 @@ class DefaultLoader extends Loader {
|
||||
Components::set( 'BOOTSTRAP_CDN', self::BOOTSTRAP_CDN );
|
||||
$this->addCss( '<link rel="stylesheet" href="{ROOT_URL}app/css/main.css">' );
|
||||
$this->addJs( '<script language="JavaScript" crossorigin="anonymous" type="text/javascript" src="{ROOT_URL}app/js/main.js"></script>' );
|
||||
Components::set( 'LOGO', Config::getValue( 'main/logo' ) );
|
||||
Components::set( 'FOOT', Navigation::getMenuView( 'foot', 'FOOTER_LINKS', App::FOOTER_MENU_NAME, false ) );
|
||||
Components::set( 'COPY', Views::simpleView( 'copy') );
|
||||
Components::setIfNull( 'LOGO', Config::getValue( 'main/logo' ) );
|
||||
Components::setIfNull( 'FOOTER_LEFT', Navigation::getMenuView( 'footer.left', 'FOOTER_LINKS', App::FOOTER_MENU_NAME, false ) );
|
||||
Components::setIfNull( 'FOOTER_CENTER', Views::simpleView( 'footer.center') );
|
||||
Components::setIfNull( 'FOOTER_RIGHT', Views::simpleView( 'footer.right') );
|
||||
Components::setIfNull( 'FOOT', Views::simpleView( 'footer.container') );
|
||||
Components::setIfNull( 'COPY', Views::simpleView( 'copy') );
|
||||
/**
|
||||
* Top-Nav
|
||||
*/
|
||||
|
@ -1,44 +0,0 @@
|
||||
<div class="footer-head" id="footer-head">
|
||||
<div class="container">
|
||||
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 text-center hidden-lg hidden-md hidden-sm">
|
||||
<a href="#footer" class="navbar-toggle collapsed" data-toggle="collapse">
|
||||
<span class="bars"></span>
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
</a>
|
||||
</div>
|
||||
<div id="footer" class="navbar-collapse collapse">
|
||||
<div class="row">
|
||||
<div class="col-lg-3 col-md-3 col-sm-4 col-xs-12 text-center">
|
||||
<h3> Contact </h3>
|
||||
<ul>
|
||||
{FOOTER_LINKS}
|
||||
</ul>
|
||||
</div>
|
||||
<div class="col-lg-6 col-md-6 col-sm-4 col-xs-4 text-center">
|
||||
<div class="social">
|
||||
<i><a href="{ROOT_URL}fb"><span class="fa fa-facebook"></span></a></i>
|
||||
<i><a href="{ROOT_URL}twitter"><span class="fa fa-twitter"></span></a></i>
|
||||
<i><a href="{ROOT_URL}in"><span class="fa fa-linkedin"></span></a></i>
|
||||
<i><a href="{ROOT_URL}youtube"><span class="fa fa-youtube"></span></a></i>
|
||||
<i><a href="{ROOT_URL}git"><span class="fa fa-github"></span></a></i>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-3 col-md-3 col-sm-4 col-xs-8 pull-right text-center">
|
||||
<h3>Subscribe</h3>
|
||||
<ul>
|
||||
<li>
|
||||
<div class="input-append newsletter-box">
|
||||
hey stupid, this should not be here, this should live in the subscribe plugin
|
||||
<form action="{ROOT_URL}subscribe/home" method="post" class="form-horizontal">
|
||||
<input type="email" class="full" placeholder="Email" id="email" name="email" autocomplete="email">
|
||||
<input type="hidden" name="token" value="{TOKEN}">
|
||||
<button name="submit" value="submit" type="submit" class="btn btn-lg btn-primary center-block">Subscribe</button>
|
||||
</form>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
9
app/views/footer/center.html
Normal file
9
app/views/footer/center.html
Normal file
@ -0,0 +1,9 @@
|
||||
<div class="col-lg-6 text-center">
|
||||
<div class="social">
|
||||
<i><a href="{ROOT_URL}fb"><span class="fa fa-facebook"></span></a></i>
|
||||
<i><a href="{ROOT_URL}twitter"><span class="fa fa-twitter"></span></a></i>
|
||||
<i><a href="{ROOT_URL}in"><span class="fa fa-linkedin"></span></a></i>
|
||||
<i><a href="{ROOT_URL}youtube"><span class="fa fa-youtube"></span></a></i>
|
||||
<i><a href="{ROOT_URL}git"><span class="fa fa-github"></span></a></i>
|
||||
</div>
|
||||
</div>
|
17
app/views/footer/container.html
Normal file
17
app/views/footer/container.html
Normal file
@ -0,0 +1,17 @@
|
||||
<div class="footer-head" id="footer-head">
|
||||
<div class="container">
|
||||
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 text-center hidden-lg hidden-md hidden-sm">
|
||||
<a href="#footer" class="navbar-toggle collapsed" data-toggle="collapse">
|
||||
<span class="bars"></span>
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
</a>
|
||||
</div>
|
||||
<div id="footer" class="navbar-collapse collapse">
|
||||
<div class="row">
|
||||
{FOOTER_LEFT}
|
||||
{FOOTER_CENTER}
|
||||
{FOOTER_RIGHT}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
7
app/views/footer/left.html
Normal file
7
app/views/footer/left.html
Normal file
@ -0,0 +1,7 @@
|
||||
|
||||
<div class="col-lg-3 text-center">
|
||||
<h3> Contact </h3>
|
||||
<ul>
|
||||
{FOOTER_LINKS}
|
||||
</ul>
|
||||
</div>
|
15
app/views/footer/right.html
Normal file
15
app/views/footer/right.html
Normal file
@ -0,0 +1,15 @@
|
||||
|
||||
<div class="col-lg-3 text-center">
|
||||
<h3>Information</h3>
|
||||
<ul>
|
||||
<li>
|
||||
<a href="{ROOT_URL}about">About Us</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="{ROOT_URL}contact">Contact Us</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="{ROOT_URL}privacy">Privacy Policy</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
Reference in New Issue
Block a user