Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Call to undefined function url_decode() in Ion_auth_model.php on line 1813 #104

Open
wants to merge 44 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
a5b1b6b
Fixed Swagger API Host link
waifung0207 Jun 12, 2016
e0c7c7b
Mention latest build number from README
waifung0207 Jun 12, 2016
271d2fd
Updated Summernote to v0.8.1; copied config file of Grocery CRUD / Im…
waifung0207 Jun 12, 2016
a5fd645
Add trumbowyg as an option to Grocery CRUD editor
waifung0207 Jun 12, 2016
fdd87be
Some tidy up before setting demo repo
waifung0207 Jun 13, 2016
71d4ff9
Update default email setting to use Mailgun platform
waifung0207 Jun 22, 2016
1e959fb
Tidy up email sending; now use MY_Email instead of Email_client, conf…
waifung0207 Jun 22, 2016
714022e
Update build number
waifung0207 Jun 22, 2016
4e3d8e3
Add Utilities page to manage database version
waifung0207 Jun 22, 2016
f1dee5d
Admin Panel limit utility controller to be accessed by webmaster only
waifung0207 Jun 22, 2016
87b5d1d
Update README
waifung0207 Jun 22, 2016
6341f12
Fixed MY_Form_validation bug
waifung0207 Jul 2, 2016
d26ed39
Update build number
waifung0207 Jul 2, 2016
b0bcbdd
Update Admin Panel so less changes are required when rename 'admin' m…
waifung0207 Jul 7, 2016
b8f620c
Missing updates for last commit
waifung0207 Jul 7, 2016
950be6e
Update build number
waifung0207 Jul 7, 2016
a449edf
Fix build number
waifung0207 Jul 7, 2016
6a777f0
Prepare basic structure
waifung0207 Jul 19, 2016
aae0a0e
Revert "Fix build number"
waifung0207 Jul 19, 2016
7cb2215
Fixing latest commits
waifung0207 Jul 19, 2016
876eb8e
Fix conflict
waifung0207 Jul 19, 2016
2b7ae5f
Fix header for API site
waifung0207 Jul 27, 2016
6af28c8
Upgraded to CodeIgniter 3.1.0
waifung0207 Aug 22, 2016
08f25cc
Updated bower packages, includes AdminLTE to v2.3.6
waifung0207 Aug 22, 2016
b10e696
Fixed multilingual routing
waifung0207 Aug 22, 2016
985eeee
Update README
waifung0207 Aug 23, 2016
4ea5cdc
Fix Grocery CRUD search boolean field by typing 0 value
waifung0207 Sep 8, 2016
3ae65ff
Allow changing order_direction when use Sortable library
waifung0207 Sep 8, 2016
a701b6a
update sidebar to AdminLTE to v2.3.6
Nov 2, 2016
31b21ce
Merge pull request #85 from circuitmamu/patch-1
waifung0207 Nov 7, 2016
82778cc
Update CodeIgniter to v3.1.2, update bower packages
waifung0207 Nov 7, 2016
322b927
Update Grocery CRUD to v1.5.7
waifung0207 Nov 7, 2016
85a3f48
Update codeigniter-restserver library
waifung0207 Dec 9, 2016
79a9580
Update Ion Auth; fixed some config from last commit
waifung0207 Dec 9, 2016
efa085f
Update version
waifung0207 Dec 9, 2016
d234f91
Add functions from codeigniter-restserver to API_Controller
waifung0207 Dec 27, 2016
99a0919
Update Admin_Controller.php pass $layout to parent
walaman Jan 25, 2017
6b0dcba
Merge pull request #96 from walaman/patch-1
waifung0207 Jan 25, 2017
0b0044d
Fix Swagger Doc page API Protocol
waifung0207 Mar 10, 2017
c8739f8
Update to CodeIgniter 3.1.3
waifung0207 Mar 18, 2017
b3581e5
Fix HMVC Loader issue with CodeIgniter 3.1.3
waifung0207 Mar 18, 2017
b9b4e41
Update Admin LTE to 2.3.11
waifung0207 Mar 18, 2017
900daa0
Update Grocery CRUD to 1.5.8
waifung0207 Mar 18, 2017
8ce330c
Update Ion Auth to latest version
waifung0207 Mar 24, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
23 changes: 12 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
## CodeIgniter 3 Bootstrap
## CodeIgniter 3 Bootstrap

**Latest Build: 2017-03-24**

**Note: This project is still in progress, but welcome for any issues encountered**

A starter template that supports multi-tenant (Frontend / Admin Panel / API) website in a single application.

This repository is developed upon the following tools:
* [CodeIgniter](http://www.codeigniter.com/) (v3.0.6) - PHP framework
* [CodeIgniter](http://www.codeigniter.com/) (v3.1.3) - PHP framework
* [CodeIgniter HMVC Extensions](https://bitbucket.org/wiredesignz/codeigniter-modular-extensions-hmvc) - modular structure by [wiredesignz](http://wiredesignz.co.nz/)
* [codeigniter-base-model](https://github.com/jamierumbelow/codeigniter-base-model) - more advanced CRUD functions for models by [jamierumbelow](https://github.com/jamierumbelow)
* [codeigniter-restserver](https://github.com/chriskacerguis/codeigniter-restserver) - base setup for API module
* [Ion Auth](http://benedmunds.com/ion_auth/) - authentication library for CodeIgniter by [Ben Edmunds](http://benedmunds.com/)
* [Bootstrap](http://getbootstrap.com/) (v3.3.6) - popular frontend framework
* [Grocery CRUD](http://www.grocerycrud.com/) (v1.5.5) - feature-rich library to build CRUD tables
* [Bootstrap](http://getbootstrap.com/) (v3.3.7) - popular frontend framework
* [Grocery CRUD](http://www.grocerycrud.com/) (v1.5.8) - feature-rich library to build CRUD tables
* [Image CRUD](http://www.grocerycrud.com/image-crud) (v0.6) - CRUD library for image management
* [AdminLTE](https://github.com/almasaeed2010/AdminLTE) (v2.3.3) - bootstrap theme for Admin Panel
* [AdminLTE](https://github.com/almasaeed2010/AdminLTE) (v2.3.11) - bootstrap theme for Admin Panel


### Features
Expand All @@ -40,7 +42,7 @@ This repository contains setup for rapid development:
* ... more coming!


### Demo Project (in progress)
### Demo Project

A demo repository can be found from: https://github.com/waifung0207/ci_bootstrap_3_demo

Expand All @@ -49,7 +51,7 @@ A demo repository can be found from: https://github.com/waifung0207/ci_bootstrap

Below configuration are preferred; other environments are not well-tested, but still feel free to report and issues.

* **PHP 5.5+**
* **PHP 5.6+**
* **Apache 2.2+** with rewrite mod enabled
* **MySQL 5.5+** (not tested on MariaDB)

Expand Down Expand Up @@ -86,7 +88,7 @@ application/ --- Main CodeIgniter source files
autoload.php --- By default, some files are loaded for this repo
ci_bootstrap.php --- Core configuration file for all sites
database.php --- Need to verify to ensure connection with MySQL database
email.php --- Created to centralize email configuration (preset: using Mandrill service)
email.php --- Created to centralize email configuration (default: using Mailgun)
form_validation.php --- Created to centralize validation forms for all forms, include ReCAPTCHA settings
routes.php --- Changed default controller from Welcome to Home
controllers/ --- Controllers for Frontend Website; extends from MY_Controller (except Cli)
Expand All @@ -99,7 +101,8 @@ application/ --- Main CodeIgniter source files
MY_Router.php --- Required for HMVC extension
helpers/ --- Contains custom helper functions being used throughout this repo
language/ --- Preset language files
libraries/ --- Custom libraries (e.g. Ion Auth, Form Builder, System Message)
libraries/ --- Custom libraries (e.g. Form Builder, System Message)
MY_Email.php --- Enhanced email library, includes work with Mailgun API
models/ --- Sample model extending from MY_Model
modules/ --- Each module can be accessed by http://{base_url}/{module_name}/{module_controller}/, etc.
admin/ --- Module for Admin Panel
Expand Down Expand Up @@ -170,7 +173,5 @@ More screenshots can be viewed from the [screenshots folder](https://github.com/
* Changelog file
* Better documentation (e.g. on [Gitbook](http://gitbook.com/))
* Enhance Form Builder library to support more field types
* API authentication (by API key or JSON Web Token, i.e. JWT)
* Database backup and restore versions
* Grocery CRUD / Image CRUD file upload - add Amazon S3 integration
* Grocery CRUD / Image CRUD image upload - add cropping feature
14 changes: 13 additions & 1 deletion application/config/ci_bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,19 @@

// Restricted pages
'page_auth' => array(
'test' => array('membders'),
),

// Email config
'email' => array(
'from_email' => '',
'from_name' => '',
'subject_prefix' => '',

// Mailgun HTTP API
'mailgun_api' => array(
'domain' => '',
'private_api_key' => ''
),
),

// Debug tools
Expand Down
13 changes: 13 additions & 0 deletions application/config/ci_bootstrap_example.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,19 @@
'panel/admin_user_group' => array('webmaster'),
),

// Email config (to be used in MY_Email library)
'email' => array(
'from_email' => 'noreply@email.com',
'from_name' => 'CI Bootstrap',
'subject_prefix' => '[CI Bootstrap] ',

// Mailgun HTTP API
'mailgun_api' => array(
'domain' => '',
'private_api_key' => ''
),
),

// Debug tools (available only when ENVIRONMENT = 'development')
'debug' => array(
'view_data' => FALSE, // whether to display MY_Controller's mViewData at page end
Expand Down
10 changes: 7 additions & 3 deletions application/config/constants.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,15 +93,19 @@
*/
if (!(PHP_SAPI === 'cli' OR defined('STDIN')))
{
// Base URL with directory support; also for API prefix in Swagger annotation (/application/modules/api/swagger/info.php)
// Base URL with directory support
$protocol = (!empty($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS'])!== 'off') ? 'https' : 'http';
$base_url = $protocol.'://'.$_SERVER['HTTP_HOST'];
$base_url.= dirname($_SERVER['SCRIPT_NAME']);
define('BASE_URL', $base_url);

// For API prefix in Swagger annotation (/application/modules/api/swagger/info.php)
define('API_PROTOCOL', $protocol);
define('API_HOST', $_SERVER['HTTP_HOST'].dirname($_SERVER['SCRIPT_NAME']));
}

define('CI_BOOTSTRAP_REPO', 'https://github.com/waifung0207/ci_bootstrap_3');
define('CI_BOOTSTRAP_VERSION', 'Build 20160610'); // will follow semantic version (e.g. v1.x.x) after first stable launch
define('CI_BOOTSTRAP_VERSION', 'Build 20170324'); // will follow semantic version (e.g. v1.x.x) after first stable launch

// Upload paths
//define('UPLOAD_COVER_PHOTO', 'assets/uploads/cover_photos');
//define('UPLOAD_COVER_PHOTO', 'assets/uploads/cover_photos');
15 changes: 2 additions & 13 deletions application/config/email.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,12 @@
| */

$config['protocol'] = 'smtp';
$config['smtp_host'] = 'smtp.mandrillapp.com';
$config['smtp_host'] = 'smtp.mailgun.org';
$config['smtp_port'] = '587';
$config['smtp_timeout'] = '30';
$config['smtp_user'] = 'username';
$config['smtp_user'] = 'postmaster@yourdomain.com';
$config['smtp_pass'] = 'password';
$config['charset'] = 'utf-8';
$config['mailtype'] = 'html';
$config['wordwrap'] = TRUE;
$config['newline'] = "\r\n";

// custom values from CI Bootstrap
$config['from_email'] = "noreply@email.com";
$config['from_name'] = "CI Bootstrap";
$config['subject_prefix'] = "[CI Bootstrap] ";

// Mailgun API (to be used in Email Client library)
$config['mailgun'] = array(
'domain' => '',
'private_api_key' => '',
);
6 changes: 3 additions & 3 deletions application/config/routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,11 @@
/*
| -------------------------------------------------------------------------
| Added by CI Bootstrap 3
| Multilingual routing (update "en|zh|cn|es" for available languages)
| Multilingual routing (use 2 characters (e.g. en, zh, cn, es) for switching languages)
| -------------------------------------------------------------------------
*/
$route['^en|zh|cn|es/(.+)$'] = "$1";
$route['^en|zh|cn|es$'] = $route['default_controller'];
$route['^(\w{2})/(.*)$'] = '$2';
$route['^(\w{2})$'] = $route['default_controller'];

/*
| -------------------------------------------------------------------------
Expand Down
96 changes: 96 additions & 0 deletions application/config/testing/database.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');

/*
| -------------------------------------------------------------------
| DATABASE CONNECTIVITY SETTINGS
| -------------------------------------------------------------------
| This file will contain the settings needed to access your database.
|
| For complete instructions please consult the 'Database Connection'
| page of the User Guide.
|
| -------------------------------------------------------------------
| EXPLANATION OF VARIABLES
| -------------------------------------------------------------------
|
| ['dsn'] The full DSN string describe a connection to the database.
| ['hostname'] The hostname of your database server.
| ['username'] The username used to connect to the database
| ['password'] The password used to connect to the database
| ['database'] The name of the database you want to connect to
| ['dbdriver'] The database driver. e.g.: mysqli.
| Currently supported:
| cubrid, ibase, mssql, mysql, mysqli, oci8,
| odbc, pdo, postgre, sqlite, sqlite3, sqlsrv
| ['dbprefix'] You can add an optional prefix, which will be added
| to the table name when using the Query Builder class
| ['pconnect'] TRUE/FALSE - Whether to use a persistent connection
| ['db_debug'] TRUE/FALSE - Whether database errors should be displayed.
| ['cache_on'] TRUE/FALSE - Enables/disables query caching
| ['cachedir'] The path to the folder where cache files should be stored
| ['char_set'] The character set used in communicating with the database
| ['dbcollat'] The character collation used in communicating with the database
| NOTE: For MySQL and MySQLi databases, this setting is only used
| as a backup if your server is running PHP < 5.2.3 or MySQL < 5.0.7
| (and in table creation queries made with DB Forge).
| There is an incompatibility in PHP with mysql_real_escape_string() which
| can make your site vulnerable to SQL injection if you are using a
| multi-byte character set and are running versions lower than these.
| Sites using Latin-1 or UTF-8 database character set and collation are unaffected.
| ['swap_pre'] A default table prefix that should be swapped with the dbprefix
| ['encrypt'] Whether or not to use an encrypted connection.
|
| 'mysql' (deprecated), 'sqlsrv' and 'pdo/sqlsrv' drivers accept TRUE/FALSE
| 'mysqli' and 'pdo/mysql' drivers accept an array with the following options:
|
| 'ssl_key' - Path to the private key file
| 'ssl_cert' - Path to the public key certificate file
| 'ssl_ca' - Path to the certificate authority file
| 'ssl_capath' - Path to a directory containing trusted CA certificats in PEM format
| 'ssl_cipher' - List of *allowed* ciphers to be used for the encryption, separated by colons (':')
| 'ssl_verify' - TRUE/FALSE; Whether verify the server certificate or not ('mysqli' only)
|
| ['compress'] Whether or not to use client compression (MySQL only)
| ['stricton'] TRUE/FALSE - forces 'Strict Mode' connections
| - good for ensuring strict SQL while developing
| ['ssl_options'] Used to set various SSL options that can be used when making SSL connections.
| ['failover'] array - A array with 0 or more data for connections if the main should fail.
| ['save_queries'] TRUE/FALSE - Whether to "save" all executed queries.
| NOTE: Disabling this will also effectively disable both
| $this->db->last_query() and profiling of DB queries.
| When you run a query, with this setting set to TRUE (default),
| CodeIgniter will store the SQL statement for debugging purposes.
| However, this may cause high memory usage, especially if you run
| a lot of SQL queries ... disable this to avoid that problem.
|
| The $active_group variable lets you choose which connection group to
| make active. By default there is only one group (the 'default' group).
|
| The $query_builder variables lets you determine whether or not to load
| the query builder class.
*/
$active_group = 'default';
$query_builder = TRUE;

$db['default'] = array(
'dsn' => '',
'hostname' => 'localhost',
'username' => '',
'password' => '',
'database' => '',
'dbdriver' => 'mysqli',
'dbprefix' => '',
'pconnect' => FALSE,
'db_debug' => (ENVIRONMENT !== 'production'),
'cache_on' => FALSE,
'cachedir' => '',
'char_set' => 'utf8',
'dbcollat' => 'utf8_general_ci',
'swap_pre' => '',
'encrypt' => FALSE,
'compress' => FALSE,
'stricton' => FALSE,
'failover' => array(),
'save_queries' => TRUE
);
2 changes: 2 additions & 0 deletions application/controllers/Cli.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,13 @@ public function clean_db()
$this->load->database();

echo '====== Task: Empty database'.PHP_EOL;
/*
$this->db->truncate('cover_photos');
$this->db->truncate('blog_categories');
$this->db->truncate('blog_tags');
$this->db->truncate('blog_post_tag_rel');
$this->db->truncate('blog_posts');
*/
echo '====== Task: Empty database (Completed)'.PHP_EOL;
}

Expand Down
3 changes: 0 additions & 3 deletions application/core/MY_Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,6 @@ private function _setup()
}

$this->mConfig = $config;

// fix usage of MY_Form_validation in HMVC structure
$this->form_validation->CI =& $this;
}

// Verify user login (regardless of user group)
Expand Down
8 changes: 4 additions & 4 deletions application/core/MY_Lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*
* This content is released under the MIT License (MIT)
*
* Copyright (c) 2014 - 2016, British Columbia Institute of Technology
* Copyright (c) 2014 - 2017, British Columbia Institute of Technology
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
Expand All @@ -30,9 +30,9 @@
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (http://ellislab.com/)
* @copyright Copyright (c) 2014 - 2016, British Columbia Institute of Technology (http://bcit.ca/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link http://codeigniter.com
* @link https://codeigniter.com
* @since Version 1.0.0
* @filesource
*/
Expand All @@ -59,7 +59,7 @@
* @subpackage Libraries
* @category Language
* @author EllisLab Dev Team
* @link http://codeigniter.com/user_guide/libraries/language.html
* @link https://codeigniter.com/user_guide/libraries/language.html
*/
class MY_Lang extends CI_Lang {

Expand Down
17 changes: 16 additions & 1 deletion application/core/MY_Loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,19 @@
/* load the MX_Loader class */
require APPPATH."third_party/MX/Loader.php";

class MY_Loader extends MX_Loader {}
class MY_Loader extends MX_Loader
{
/** Load a module view **/
public function view($view, $vars = array(), $return = FALSE)
{
list($path, $_view) = Modules::find($view, $this->_module, 'views/');

if ($path != FALSE)
{
$this->_ci_view_paths = array($path => TRUE) + $this->_ci_view_paths;
$view = $_view;
}

return $this->_ci_load(array('_ci_view' => $view, '_ci_vars' => ((method_exists($this,'_ci_object_to_array')) ? $this->_ci_object_to_array($vars) : $this->_ci_prepare_view_vars($vars)), '_ci_return' => $return));
}
}
3 changes: 1 addition & 2 deletions application/core/MY_Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ class MY_Model extends Base_Model {
public $before_get = array('callback_before_get');
public $after_get = array('callback_after_get');

// Variables from CI Bootstrap
// (sample usage: see Cover_photo_model, Blog_post_model)
// Variables from CI Bootstrap (see demo repo for examples)
protected $where = array();
protected $order_by = array();
protected $upload_fields = array();
Expand Down
4 changes: 2 additions & 2 deletions application/core/controllers/Admin_Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ protected function render($view_file, $layout = 'default')
// additional view data
$this->mViewData['useful_links'] = $this->mUsefulLinks;

parent::render($view_file);
parent::render($view_file, $layout);
}

// Initialize CRUD table via Grocery CRUD library
Expand Down Expand Up @@ -158,4 +158,4 @@ protected function render_crud()
$this->mViewData['crud_output'] = $crud_data->output;
$this->render('crud');
}
}
}
Loading