Skip to content

Commit

Permalink
Merge branch 'release/v1.0.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
David McReynolds committed Jan 3, 2014
2 parents 70883a9 + 821567f commit 8e3160f
Show file tree
Hide file tree
Showing 36 changed files with 511 additions and 159 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ folder and browse to the index.php file. Next, follow the directions on the
screen.

### Documentation
To access the documentation, you can visit it [here](http://www.getfuelcms.com/user_guide).
To access the documentation, you can visit it [here](http://docs.getfuelcms.com).

### Bugs
To file a bug report, go to the [issues](http://github.com/daylightstudio/FUEL-CMS/issues) page.
Expand Down
3 changes: 3 additions & 0 deletions fuel/application/config/redirects.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@
// The paths to force SSL with the key being the environment it belongs to
$config['ssl'] = array('development' => array());

// The paths to force NON SSL with the key being the environment it belongs to
$config['non_ssl'] = array('development' => array());

// The host name to enforce (e.g. mysite.com vs www.mysite.com) with the key being the environment it belongs to
$config['host'] = array('production' => '');

Expand Down
2 changes: 1 addition & 1 deletion fuel/index.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<?php
header('Location: dashboard');
header('Location: index');
exit();
19 changes: 15 additions & 4 deletions fuel/modules/fuel/assets/css/fuel.css
Original file line number Diff line number Diff line change
Expand Up @@ -214,13 +214,22 @@ textarea[disabled] {
color: #888;
cursor: default;
}
input[readonly],
textarea[readonly],
select[readonly] { background-color: transparent; border: none;
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none;
}

textarea,
select[size],
select[multiple] {
height: auto;
}

input[type="file"] { border: 1px dashed #ccc; border-radius: 3px; padding: 10px; }

/* Tweaks for Safari + Chrome. */
@media (-webkit-min-device-pixel-ratio: 0) {
select { background-image: url(../images/select_arrow.gif); background-repeat: no-repeat; background-position: right center; padding-right: 20px; }
Expand Down Expand Up @@ -618,15 +627,16 @@ div#tree_container { padding: 16px 15px; }
div#tree_loader { position: absolute; top: 20px; left: 50%; margin-left: -25px; z-index: 2;}

/* #login */
div#login { padding: 18% 0 0 0; border: none; background-color: transparent; text-align: center; width: 270px; margin: 0 auto; }
div#login h3 { color: #fff; }
div#login { padding: 15% 0 0 0; border: none; background-color: transparent; margin: 0 auto; }
div#login h3 { color: #fff; text-align: center; }
div#login form { width: 270px; margin: 0 auto; }
div#login input { background-color: #1d1d1d; color: #fff; -webkit-border-radius: 10px; -moz-border-radius: 10px; border-radius: 10px; border: 2px solid #444; height: 40px; width: 270px; padding: 0 1em; }
.login_logo { background: transparent url(../images/fuel_logo.png) no-repeat; background-size: 100%; width: 233px; height: 46px; overflow: hidden; margin: 0 auto 1.5em auto; }
div#login ::-webkit-input-placeholder {color: #999; }
div#login :-moz-placeholder { color: #999; }
div#login :-ms-input-placeholder { color: #999; }
div#login input[type="submit"] { background: #3dbfd9 !important; color: #fff; font-size: 20px; text-shadow: none; }
div#login_notification { text-overflow: ellipsis; overflow: hidden; margin-bottom: 5px; margin-left: -15px; margin-right: -15px; }
div#login_notification { text-overflow: ellipsis; overflow: hidden; width: 340px; margin: auto; }
a#forgotten_pwd { text-align: center; display: block; padding-top: 15px; padding-left:20px; color: #999; }

/* assets & modal */
Expand All @@ -646,6 +656,7 @@ div#yes_no_modal li { display: inline-block; margin-right: 5px; float: none;}

div#__FUEL_modal__ { -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; width: 98%; max-width: 864px; margin-left: -425px; max-height: 508px; background-color: #fff; }
div#__FUEL_modal__ .add_inline_button, div#__FUEL_modal__ .edit_inline_button { display: none; }
a.btn_field_right { display: block; float: right; margin-bottom: 5px; margin-right: 3px; }
div.img_display { float: right; overflow: auto; height: 120px; width: 300px; }


Expand Down Expand Up @@ -687,7 +698,7 @@ div.perms_list label { font-weight: bold; }
.match_class { display: block; position: absolute; z-index: 10; margin-bottom: 0px; min-height: 30px;}
.match_class span { display: inline-block; cursor: pointer; padding: 3px; background-color: #fcfce6; border: 1px solid #ccc; margin: 3px 0 3px 3px; }

.multi_field { margin-bottom: 10px; }
.multi_field { margin-bottom: 10px; display: inline-block; padding-top: 2px; }

/* ckeditor */
.cke_top { min-width: 565px !important; }
2 changes: 1 addition & 1 deletion fuel/modules/fuel/assets/css/fuel.min.css

Large diffs are not rendered by default.

51 changes: 35 additions & 16 deletions fuel/modules/fuel/assets/js/fuel/custom_fields.js
Original file line number Diff line number Diff line change
Expand Up @@ -560,16 +560,18 @@ fuel.fields.inline_edit_field = function(context){
var fieldId = $field.attr('id');
var $form = $field.closest('form');
var module = $field.data('module');

var isMulti = ($field.attr('multiple')) ? true : false;

var parentModule = fuel.getModuleURI(context);
var url = jqx_config.fuelPath + '/' + module + '/inline_';

if (!$field.parent().find('.add_inline_button').length) $field.after('&nbsp;<a href="' + url + 'create" class="btn_field add_inline_button">' + fuel.lang('btn_add') + '</a>');
if (!$field.parent().find('.edit_inline_button').length) $field.after('&nbsp;<a href="' + url + 'edit/" class="btn_field edit_inline_button">' + fuel.lang('btn_edit') + '</a>');
var btnClasses = ($field.attr('multiple')) ? 'btn_field btn_field_right ' : 'btn_field';
if (!$field.parent().find('.edit_inline_button').length) $field.after('&nbsp;<a href="' + url + 'edit/" class="' + btnClasses+ ' edit_inline_button">' + fuel.lang('btn_edit') + '</a>');
if (!$field.parent().find('.add_inline_button').length) $field.after('&nbsp;<a href="' + url + 'create" class="' + btnClasses+ ' add_inline_button">' + fuel.lang('btn_add') + '</a>');

var refreshField = function($field){

//$field = (field != undefined) ? field : $field;

// redeclared here in case $field is set
Expand Down Expand Up @@ -597,14 +599,16 @@ fuel.fields.inline_edit_field = function(context){

// for sortable fields
var fieldName = $field.attr('name');
fieldName = fieldName.replace('[', '\\[');
fieldName = fieldName.replace(']', '\\]');
if (fieldName){
fieldName = fieldName.replace('[', '\\[');
fieldName = fieldName.replace(']', '\\]');
var selector = '[name=' + fieldName + ']';
}

var $form = $field.closest('form');

$fieldContainer = $('#' + fieldId, context).closest('td.value');
$field.closest('form').trigger('form-pre-serialize');
var selector = '[name=' + fieldName + ']';

// refresh value
$field = $(selector);
Expand Down Expand Up @@ -665,22 +669,37 @@ fuel.fields.inline_edit_field = function(context){
});

$('.edit_inline_button', context).unbind().click(function(e){
var $elem = $(this).parent().find('select');
var val = $elem.val();

var fieldName = $elem.attr('name')
fieldName = fieldName.replace('[', '');
fieldName = fieldName.replace(']', '');
var sortName = 'sorting_' + fieldName;
var form = $(this).parents('form');

var $elem = $(this).parent().find('select, input[type="checkbox"], input[type="radio"]');
if ($elem.length){
if ($elem.is('input[type="checkbox"]')){
var valArr = [];
$elem.each(function(i){
if ($(this).prop('checked')){
valArr.push($(this).val());
}
})
val = valArr.join(',');
} else {
var val = $elem.val();
}

var fieldName = $elem.attr('name')
fieldName = fieldName.replace('[', '');
fieldName = fieldName.replace(']', '');
var sortName = 'sorting_' + fieldName;
var form = $(this).parents('form');
} else {
$elem = $(this);
var val = $elem.data('value');
}

if (!val){
alert(fuel.lang('edit_multi_select_warning'));
return false;
}
var editIds = val.toString().split(',');
var $selected = $elem.parent().find('.supercomboselect_right li.selected:first');

if ((!editIds.length || editIds.length > 1) && (!$selected.length || $selected.length > 1)) {
alert(fuel.lang('edit_multi_select_warning'));
} else {
Expand Down
14 changes: 14 additions & 0 deletions fuel/modules/fuel/controllers/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php

class Index extends CI_Controller {

public function __construct()
{
parent::__construct();
}

public function _remap($segment)
{
redirect($this->fuel->config('login_redirect'));
}
}
5 changes: 2 additions & 3 deletions fuel/modules/fuel/controllers/login.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public function index()

$forward = $this->input->post('forward');
$forward_uri = uri_safe_decode($forward);
if ($forward AND $forward_uri != fuel_uri('dashboard'))
if ($forward AND $forward_uri != $this->fuel->config('login_redirect'))
{
redirect($forward_uri);
}
Expand Down Expand Up @@ -184,9 +184,7 @@ public function pwd_reset()
if (!empty($user['email']))
{
$users = $this->fuel->users;

$new_pwd = $this->fuel->users->reset_password($user['email']);

if ($new_pwd !== FALSE)
{
$url = 'reset/'.md5($user['email']).'/'.md5($new_pwd);
Expand All @@ -205,6 +203,7 @@ public function pwd_reset()
else
{
$this->session->set_flashdata('error', lang('error_pwd_reset'));
$this->fuel->logs->write($this->fuel->notification->last_error(), 'debug');
}
redirect(fuel_uri('login'));
}
Expand Down
44 changes: 34 additions & 10 deletions fuel/modules/fuel/controllers/module.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ function __construct($validate = TRUE)
$params = $this->module_obj->info();
}

// stop here if the module is disabled
if ($params['disabled'] === TRUE)
{
show_404();
}
foreach($params as $key => $val)
{
$this->$key = $val;
Expand Down Expand Up @@ -2053,7 +2058,7 @@ protected function _process_uploads($posted = NULL)
}
return $return;');

// hacky but avoids 5.3 funcation syntax (which is nicer but doesn't work with 5.2)
// hacky but avoids 5.3 function syntax (which is nicer but doesn't work with 5.2)
$GLOBALS['__tmp_transient_posted__'] = $posted;

$field_value = preg_replace_callback('#^(.*)\{(.+)\}(.*)$#', $callback, $field_value);
Expand Down Expand Up @@ -2105,21 +2110,40 @@ protected function _process_uploads($posted = NULL)
{
$file_tmp = current(explode('___', $key));

// if there is a field with the suffix of _upload, then we will overwrite that posted value with this value
if (substr($file_tmp, ($file_tmp - 7)) == '_upload')
{
$field_name = substr($file_tmp, 0, ($file_tmp - 7));
}

// get the file name field
// if the file name field exists AND there is no specified hidden filename field to assign to it AND...
// the model does not have an array key field AND there is a key field value posted
if (isset($field_name) AND isset($posted[$field_name]) AND !is_array($this->model->key_field()) AND isset($posted[$this->model->key_field()]))
if (isset($field_name) AND !is_array($this->model->key_field()) AND isset($posted[$this->model->key_field()]))
{
$id = $posted[$this->model->key_field()];
$data = $this->model->find_one_array(array($this->model->table_name().'.'.$this->model->key_field() => $id));
$data[$field_name] = $val['file_name'];
$this->model->save($data);

// if there is a field with the suffix of _upload, then we will overwrite that posted value with this value
if (substr($file_tmp, ($file_tmp - 7)) == '_upload')
{
$field_name = substr($file_tmp, 0, ($file_tmp - 7));
}

if (isset($posted[$field_name]))
{
$save = TRUE;
}

// look for repeatable values that match
if (preg_match('#(.+)_(\d+)_(.+)#', $file_tmp, $matches))
{
if (isset($posted[$matches[1]][$matches[2]][$matches[3]]) AND isset($data[$matches[1]][$matches[2]][$matches[3]]))
{
$data[$matches[1]][$matches[2]][$matches[3]] = $posted[$file_tmp];
$save = TRUE;
}
}

if ($save)
{
$data[$field_name] = $val['file_name'];
$this->model->save($data);
}
}
}

Expand Down
23 changes: 11 additions & 12 deletions fuel/modules/fuel/controllers/users.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,29 +28,28 @@ public function edit($id = NULL, $field = NULL, $redirect = TRUE)
*/
public function login_as($id, $original_user_hash = '')
{
$CI =& get_instance();
$CI->load->library('session');
$change_logged_in_user = $CI->fuel->auth->is_super_admin();
if ($original_user_hash AND ($CI->session->userdata('original_user_hash') == $original_user_hash)) {
$this->load->library('session');
$change_logged_in_user = $this->fuel->auth->is_super_admin();
if ($original_user_hash AND ($this->session->userdata('original_user_hash') == $original_user_hash)) {
$change_logged_in_user = TRUE;
}
if ($change_logged_in_user)
{
$curr_user = $CI->fuel->auth->user_data();
$valid_user = $CI->fuel_users_model->find_one_array(array('id' => $id));
$CI->fuel->auth->set_valid_user($valid_user);
$curr_user = $this->fuel->auth->user_data();
$valid_user = $this->fuel_users_model->find_one_array(array('id' => $id));
$this->fuel->auth->set_valid_user($valid_user);
if ($original_user_hash)
{
$CI->session->unset_userdata('original_user_id');
$CI->session->unset_userdata('original_user_hash');
$this->session->unset_userdata('original_user_id');
$this->session->unset_userdata('original_user_hash');
}
else
{
$CI->session->set_userdata('original_user_id', $curr_user['id']);
$CI->session->set_userdata('original_user_hash', random_string('sha1'));
$this->session->set_userdata('original_user_id', $curr_user['id']);
$this->session->set_userdata('original_user_hash', random_string('sha1'));
}
}
redirect($CI->config->item('fuel_path', 'fuel') . 'dashboard');
redirect($this->fuel->config('login_redirect'));
}

protected function _process_create()
Expand Down
Loading

0 comments on commit 8e3160f

Please sign in to comment.