Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/ushahidi/Ushahidi_Web
Browse files Browse the repository at this point in the history
  • Loading branch information
kamaulynder committed Aug 5, 2014
2 parents 1e82f30 + 2613255 commit 36f7215
Show file tree
Hide file tree
Showing 29 changed files with 1,283 additions and 522 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,13 @@
Ushahidi 2.7.4 (Bug fix release) - 05/08/2014
-------------------------------------

### Major Fixes

* Upgraded Openlayers to version 2.13.1 (https://github.com/ushahidi/Ushahidi_Web/pull/1391)
* Stop checking what characters are in passowrd (https://github.com/ushahidi/Ushahidi_Web/pull/1373)
* Added option for admins to change the maximum file size for attaching photos to reports (https://github.com/ushahidi/Ushahidi_Web/pull/1369)
* Delete cache after changing theme so changes reflect immediately (https://github.com/ushahidi/Ushahidi_Web/pull/1368)

Ushahidi 2.7.3 (Bug fix release) - 23/04/2014
-------------------------------------

Expand Down
2 changes: 1 addition & 1 deletion application/config/version.php
Expand Up @@ -3,7 +3,7 @@
* The Ushahidi Engine version
* Make sure to update the ushahidi_version in the settings table too!
*/
$config['ushahidi_version'] = "2.7.3";
$config['ushahidi_version'] = "2.7.4";

/**
* The Ushahidi Engine DB revision number
Expand Down
2 changes: 2 additions & 0 deletions application/controllers/admin/addons/themes.php
Expand Up @@ -94,6 +94,8 @@ function index()
$this->template->content->form_saved = $form_saved;
$themes = addon::get_addons('theme');
$this->template->content->themes = $themes;
//delete cache to make sure theme is reloaded after change
$this->cache->delete_all();
}

}
2 changes: 1 addition & 1 deletion application/controllers/admin/profile.php
Expand Up @@ -62,7 +62,7 @@ public function index()
// If Password field is not blank
if ( ! empty($post->new_password))
{
$post->add_rules('new_password','required','length[5,30]','alpha_dash','matches[password_again]');
$post->add_rules('new_password','required','length['.Kohana::config('auth.password_length').']','matches[password_again]');
}
//for plugins that'd like to know what the user has to say about their profile
Event::run('ushahidi_action.profile_add_admin', $post);
Expand Down
3 changes: 3 additions & 0 deletions application/controllers/admin/settings.php
Expand Up @@ -63,6 +63,7 @@ public function site()
'allow_alerts' => '',
'allow_reports' => '',
'allow_comments' => '',
'max_upload_size' => '',
'allow_feed' => '',
'allow_feed_category' => '',
'feed_geolocation_user' => '',
Expand Down Expand Up @@ -108,6 +109,7 @@ public function site()
$post->add_rules('blocks_per_row','required','numeric');
$post->add_rules('allow_alerts','required','between[0,1]');
$post->add_rules('allow_reports','required','between[0,1]');
$post->add_rules('max_upload_size','length[0,50]', 'alpha_numeric');
$post->add_rules('allow_comments','required','between[0,2]');
$post->add_rules('allow_feed','required','between[0,1]');
$post->add_rules('allow_feed_category','required','between[0,1]');
Expand Down Expand Up @@ -264,6 +266,7 @@ public function site()
'allow_alerts' => $settings['allow_alerts'],
'allow_reports' => $settings['allow_reports'],
'allow_comments' => $settings['allow_comments'],
'max_upload_size' => $settings['max_upload_size'],
'allow_feed' => $settings['allow_feed'],
'allow_feed_category' => $settings['allow_feed_category'],
'feed_geolocation_user' => isset($settings['feed_geolocation_user']) ? $settings['feed_geolocation_user'] : null,
Expand Down
2 changes: 1 addition & 1 deletion application/controllers/admin/upgrade.php
Expand Up @@ -134,7 +134,7 @@ public function status($step = 0)
if ($step == 0)
{
$this->upgrade->logger("Downloading latest version of ushahidi...");
echo json_encode(array("status"=>"success", "message"=> Kohana.lang('upgrade.download')));
echo json_encode(array("status"=>"success", "message"=> Kohana::lang('upgrade.download')));
}

if ($step == 1)
Expand Down
10 changes: 5 additions & 5 deletions application/controllers/login.php
Expand Up @@ -245,7 +245,7 @@ public function index($user_id = 0)
// Add some filters
$post->pre_filter('trim', TRUE);

$post->add_rules('password','required', 'length['.kohana::config('auth.password_length').']','alpha_dash');
$post->add_rules('password','required', 'length['.kohana::config('auth.password_length').']');
$post->add_rules('name','required','length[3,100]');
$post->add_rules('email','required','email','length[4,64]');
$post->add_callbacks('username', array($this,'username_exists_chk'));
Expand All @@ -255,7 +255,7 @@ public function index($user_id = 0)
if ( ! empty($post->password))
{
$post->add_rules('password','required','length['.kohana::config('auth.password_length').']'
,'alpha_dash','matches[password_again]');
,'matches[password_again]');
}
//pass the post object to any plugins that care to know.
Event::run('ushahidi_action.users_add_login_form', $post);
Expand Down Expand Up @@ -389,8 +389,8 @@ public function index($user_id = 0)
$post->pre_filter('trim', TRUE);
$post->add_rules('token','required');
$post->add_rules('changeid','required');
$post->add_rules('password','required','length['.Kohana::config('auth.password_length').']','alpha_dash');
$post->add_rules('password','required','length['.Kohana::config('auth.password_length').']','alpha_dash','matches[password_again]');
$post->add_rules('password','required','length['.Kohana::config('auth.password_length').']');
$post->add_rules('password','required','length['.Kohana::config('auth.password_length').']','matches[password_again]');

if ($post->validate())
{
Expand Down Expand Up @@ -1014,7 +1014,7 @@ private function _email_resetlink( $email, $name, $secret_url )
}
catch (Exception $e)
{
Kohana::log('warning', Swift_LogContainer::getLog()->dump(true));
Kohana::log('alert', Swift_LogContainer::getLog()->dump(true));
return FALSE;
}

Expand Down
2 changes: 1 addition & 1 deletion application/controllers/members/profile.php
Expand Up @@ -72,7 +72,7 @@ public function index()
// If Password field is not blank
if ( ! empty($post->new_password))
{
$post->add_rules('new_password','required','length['.kohana::config('auth.password_length').']' ,'alpha_dash','matches[password_again]');
$post->add_rules('new_password','required','length['.kohana::config('auth.password_length').']','matches[password_again]');
}
//for plugins that want to know what the user had to say about things
Event::run('ushahidi_action.profile_post_member', $post);
Expand Down
3 changes: 2 additions & 1 deletion application/helpers/reports.php
Expand Up @@ -110,7 +110,8 @@ public static function validate(array & $post)
}

// Validate photo uploads
$post->add_rules('incident_photo', 'upload::valid', 'upload::type[gif,jpg,png,jpeg]', 'upload::size[2M]');
$max_upload_size = Kohana::config('settings.max_upload_size');
$post->add_rules('incident_photo', 'upload::valid', 'upload::type[gif,jpg,png,jpeg]', "upload::size[".$max_upload_size."M]");


// Validate Personal Information
Expand Down
22 changes: 2 additions & 20 deletions application/models/user.php
Expand Up @@ -159,16 +159,14 @@ public static function custom_validate(array & $post, Auth $auth = NULL)
// Only check for the password if the user id has been specified and we are passing a pw
if (isset($post->user_id) AND isset($post->password))
{
$post->add_rules('password','required', 'alpha_dash', 'length['.$password_length.']');
$post->add_callbacks('password' ,'User_Model::validate_password');
$post->add_rules('password','required', 'length['.$password_length.']');
}

// If Password field is not blank and is being passed
if ( isset($post->password) AND
(! empty($post->password) OR (empty($post->password) AND ! empty($post->password_again))))
{
$post->add_rules('password','required', 'alpha_dash','length['.$password_length.']', 'matches[password_again]');
$post->add_callbacks('password' ,'User_Model::validate_password');
$post->add_rules('password','required','length['.$password_length.']', 'matches[password_again]');
}

$post->add_rules('role','required','length[3,30]', 'alpha_numeric');
Expand Down Expand Up @@ -248,22 +246,6 @@ public static function prevent_superadmin_modification(Validation $post, $field)
}
}

public static function validate_password(Validation $post, $field)
{
$_is_valid = User_Model::password_rule($post[$field]);
if (! $_is_valid)
{
$post->add_error($field,'alpha_dash');
}
}

public static function password_rule($password, $utf8 = FALSE)
{
return ($utf8 === TRUE)
? (bool) preg_match('/^[-\pL\pN#@_]++$/uD', (string) $password)
: (bool) preg_match('/^[-a-z0-9#@_]++$/iD', (string) $password);
}

/*
* Creates a random int value for a username that isn't already represented in the database
*/
Expand Down
7 changes: 7 additions & 0 deletions application/views/admin/settings/site.php
Expand Up @@ -134,6 +134,13 @@
<span class="sel-holder">
<?php print form::dropdown('allow_reports', $yesno_array, $form['allow_reports']); ?>
</span>
</div>
<!--Adding max file upload setting-->
<div class="row">
<h4><a href="#" class="tooltip" title="<?php echo Kohana::lang("tooltips.settings_max_upload_size"); ?>"><?php echo Kohana::lang('settings.site.max_upload_size');?></a></h4>
<span class="sel-holder">
<?php print form::input('max_upload_size', $form['max_upload_size'], ' class="text long2"', 'id = max_upload_size'); ?>
</span>
</div>
<div class="row">
<h4><a href="#" class="tooltip" title="<?php echo Kohana::lang("tooltips.settings_allow_alerts"); ?>"><?php echo Kohana::lang('settings.site.allow_alerts');?></a></h4>
Expand Down
Empty file modified media/img/openlayers/blank.gif
100755 → 100644
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified media/img/openlayers/cloud-popup-relative.png
100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified media/img/openlayers/east-mini.png
100755 → 100644
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified media/img/openlayers/layer-switcher-maximize.png
100755 → 100644
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified media/img/openlayers/layer-switcher-minimize.png
100755 → 100644
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified media/img/openlayers/north-mini.png
100755 → 100644
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified media/img/openlayers/slider.png
100755 → 100644
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified media/img/openlayers/south-mini.png
100755 → 100644
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified media/img/openlayers/west-mini.png
100755 → 100644
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified media/img/openlayers/zoom-minus-mini.png
100755 → 100644
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified media/img/openlayers/zoom-plus-mini.png
100755 → 100644
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified media/img/openlayers/zoom-world-mini.png
100755 → 100644
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified media/img/openlayers/zoombar.png
100755 → 100644
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 36f7215

Please sign in to comment.