Skip to content

Commit 36f7215

Browse files
committed
Merge branch 'develop' of https://github.com/ushahidi/Ushahidi_Web
2 parents 1e82f30 + 2613255 commit 36f7215

29 files changed

+1283
-522
lines changed

CHANGELOG.md

+10
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
Ushahidi 2.7.4 (Bug fix release) - 05/08/2014
2+
-------------------------------------
3+
4+
### Major Fixes
5+
6+
* Upgraded Openlayers to version 2.13.1 (https://github.com/ushahidi/Ushahidi_Web/pull/1391)
7+
* Stop checking what characters are in passowrd (https://github.com/ushahidi/Ushahidi_Web/pull/1373)
8+
* Added option for admins to change the maximum file size for attaching photos to reports (https://github.com/ushahidi/Ushahidi_Web/pull/1369)
9+
* Delete cache after changing theme so changes reflect immediately (https://github.com/ushahidi/Ushahidi_Web/pull/1368)
10+
111
Ushahidi 2.7.3 (Bug fix release) - 23/04/2014
212
-------------------------------------
313

application/config/version.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* The Ushahidi Engine version
44
* Make sure to update the ushahidi_version in the settings table too!
55
*/
6-
$config['ushahidi_version'] = "2.7.3";
6+
$config['ushahidi_version'] = "2.7.4";
77

88
/**
99
* The Ushahidi Engine DB revision number

application/controllers/admin/addons/themes.php

+2
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,8 @@ function index()
9494
$this->template->content->form_saved = $form_saved;
9595
$themes = addon::get_addons('theme');
9696
$this->template->content->themes = $themes;
97+
//delete cache to make sure theme is reloaded after change
98+
$this->cache->delete_all();
9799
}
98100

99101
}

application/controllers/admin/profile.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public function index()
6262
// If Password field is not blank
6363
if ( ! empty($post->new_password))
6464
{
65-
$post->add_rules('new_password','required','length[5,30]','alpha_dash','matches[password_again]');
65+
$post->add_rules('new_password','required','length['.Kohana::config('auth.password_length').']','matches[password_again]');
6666
}
6767
//for plugins that'd like to know what the user has to say about their profile
6868
Event::run('ushahidi_action.profile_add_admin', $post);

application/controllers/admin/settings.php

+3
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ public function site()
6363
'allow_alerts' => '',
6464
'allow_reports' => '',
6565
'allow_comments' => '',
66+
'max_upload_size' => '',
6667
'allow_feed' => '',
6768
'allow_feed_category' => '',
6869
'feed_geolocation_user' => '',
@@ -108,6 +109,7 @@ public function site()
108109
$post->add_rules('blocks_per_row','required','numeric');
109110
$post->add_rules('allow_alerts','required','between[0,1]');
110111
$post->add_rules('allow_reports','required','between[0,1]');
112+
$post->add_rules('max_upload_size','length[0,50]', 'alpha_numeric');
111113
$post->add_rules('allow_comments','required','between[0,2]');
112114
$post->add_rules('allow_feed','required','between[0,1]');
113115
$post->add_rules('allow_feed_category','required','between[0,1]');
@@ -264,6 +266,7 @@ public function site()
264266
'allow_alerts' => $settings['allow_alerts'],
265267
'allow_reports' => $settings['allow_reports'],
266268
'allow_comments' => $settings['allow_comments'],
269+
'max_upload_size' => $settings['max_upload_size'],
267270
'allow_feed' => $settings['allow_feed'],
268271
'allow_feed_category' => $settings['allow_feed_category'],
269272
'feed_geolocation_user' => isset($settings['feed_geolocation_user']) ? $settings['feed_geolocation_user'] : null,

application/controllers/admin/upgrade.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ public function status($step = 0)
134134
if ($step == 0)
135135
{
136136
$this->upgrade->logger("Downloading latest version of ushahidi...");
137-
echo json_encode(array("status"=>"success", "message"=> Kohana.lang('upgrade.download')));
137+
echo json_encode(array("status"=>"success", "message"=> Kohana::lang('upgrade.download')));
138138
}
139139

140140
if ($step == 1)

application/controllers/login.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ public function index($user_id = 0)
245245
// Add some filters
246246
$post->pre_filter('trim', TRUE);
247247

248-
$post->add_rules('password','required', 'length['.kohana::config('auth.password_length').']','alpha_dash');
248+
$post->add_rules('password','required', 'length['.kohana::config('auth.password_length').']');
249249
$post->add_rules('name','required','length[3,100]');
250250
$post->add_rules('email','required','email','length[4,64]');
251251
$post->add_callbacks('username', array($this,'username_exists_chk'));
@@ -255,7 +255,7 @@ public function index($user_id = 0)
255255
if ( ! empty($post->password))
256256
{
257257
$post->add_rules('password','required','length['.kohana::config('auth.password_length').']'
258-
,'alpha_dash','matches[password_again]');
258+
,'matches[password_again]');
259259
}
260260
//pass the post object to any plugins that care to know.
261261
Event::run('ushahidi_action.users_add_login_form', $post);
@@ -389,8 +389,8 @@ public function index($user_id = 0)
389389
$post->pre_filter('trim', TRUE);
390390
$post->add_rules('token','required');
391391
$post->add_rules('changeid','required');
392-
$post->add_rules('password','required','length['.Kohana::config('auth.password_length').']','alpha_dash');
393-
$post->add_rules('password','required','length['.Kohana::config('auth.password_length').']','alpha_dash','matches[password_again]');
392+
$post->add_rules('password','required','length['.Kohana::config('auth.password_length').']');
393+
$post->add_rules('password','required','length['.Kohana::config('auth.password_length').']','matches[password_again]');
394394

395395
if ($post->validate())
396396
{
@@ -1014,7 +1014,7 @@ private function _email_resetlink( $email, $name, $secret_url )
10141014
}
10151015
catch (Exception $e)
10161016
{
1017-
Kohana::log('warning', Swift_LogContainer::getLog()->dump(true));
1017+
Kohana::log('alert', Swift_LogContainer::getLog()->dump(true));
10181018
return FALSE;
10191019
}
10201020

application/controllers/members/profile.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public function index()
7272
// If Password field is not blank
7373
if ( ! empty($post->new_password))
7474
{
75-
$post->add_rules('new_password','required','length['.kohana::config('auth.password_length').']' ,'alpha_dash','matches[password_again]');
75+
$post->add_rules('new_password','required','length['.kohana::config('auth.password_length').']','matches[password_again]');
7676
}
7777
//for plugins that want to know what the user had to say about things
7878
Event::run('ushahidi_action.profile_post_member', $post);

application/helpers/reports.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,8 @@ public static function validate(array & $post)
110110
}
111111

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

115116

116117
// Validate Personal Information

application/models/user.php

+2-20
Original file line numberDiff line numberDiff line change
@@ -159,16 +159,14 @@ public static function custom_validate(array & $post, Auth $auth = NULL)
159159
// Only check for the password if the user id has been specified and we are passing a pw
160160
if (isset($post->user_id) AND isset($post->password))
161161
{
162-
$post->add_rules('password','required', 'alpha_dash', 'length['.$password_length.']');
163-
$post->add_callbacks('password' ,'User_Model::validate_password');
162+
$post->add_rules('password','required', 'length['.$password_length.']');
164163
}
165164

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

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

251-
public static function validate_password(Validation $post, $field)
252-
{
253-
$_is_valid = User_Model::password_rule($post[$field]);
254-
if (! $_is_valid)
255-
{
256-
$post->add_error($field,'alpha_dash');
257-
}
258-
}
259-
260-
public static function password_rule($password, $utf8 = FALSE)
261-
{
262-
return ($utf8 === TRUE)
263-
? (bool) preg_match('/^[-\pL\pN#@_]++$/uD', (string) $password)
264-
: (bool) preg_match('/^[-a-z0-9#@_]++$/iD', (string) $password);
265-
}
266-
267249
/*
268250
* Creates a random int value for a username that isn't already represented in the database
269251
*/

application/views/admin/settings/site.php

+7
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,13 @@
134134
<span class="sel-holder">
135135
<?php print form::dropdown('allow_reports', $yesno_array, $form['allow_reports']); ?>
136136
</span>
137+
</div>
138+
<!--Adding max file upload setting-->
139+
<div class="row">
140+
<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>
141+
<span class="sel-holder">
142+
<?php print form::input('max_upload_size', $form['max_upload_size'], ' class="text long2"', 'id = max_upload_size'); ?>
143+
</span>
137144
</div>
138145
<div class="row">
139146
<h4><a href="#" class="tooltip" title="<?php echo Kohana::lang("tooltips.settings_allow_alerts"); ?>"><?php echo Kohana::lang('settings.site.allow_alerts');?></a></h4>

media/img/openlayers/blank.gif

100755100644
File mode changed.

media/img/openlayers/cloud-popup-relative.png

100644100755
-3.31 KB
Loading

media/img/openlayers/east-mini.png

100755100644
File mode changed.

media/img/openlayers/layer-switcher-maximize.png

100755100644
102 Bytes
Loading

media/img/openlayers/layer-switcher-minimize.png

100755100644
-147 Bytes
Loading

media/img/openlayers/north-mini.png

100755100644
File mode changed.

media/img/openlayers/slider.png

100755100644
File mode changed.

media/img/openlayers/south-mini.png

100755100644
File mode changed.

media/img/openlayers/west-mini.png

100755100644
File mode changed.

media/img/openlayers/zoom-minus-mini.png

100755100644
File mode changed.

media/img/openlayers/zoom-plus-mini.png

100755100644
File mode changed.

media/img/openlayers/zoom-world-mini.png

100755100644
File mode changed.

media/img/openlayers/zoombar.png

100755100644
File mode changed.

0 commit comments

Comments
 (0)