diff --git a/CHANGELOG.md b/CHANGELOG.md index 73a95c77ac..e38610707a 100755 --- a/CHANGELOG.md +++ b/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 ------------------------------------- diff --git a/application/config/version.php b/application/config/version.php index 42b7f6a6b6..568aab925c 100755 --- a/application/config/version.php +++ b/application/config/version.php @@ -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 diff --git a/application/controllers/admin/addons/themes.php b/application/controllers/admin/addons/themes.php index 8f893b6c92..644151ee75 100644 --- a/application/controllers/admin/addons/themes.php +++ b/application/controllers/admin/addons/themes.php @@ -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(); } } diff --git a/application/controllers/admin/profile.php b/application/controllers/admin/profile.php index b55847f505..a1da1bd476 100644 --- a/application/controllers/admin/profile.php +++ b/application/controllers/admin/profile.php @@ -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); diff --git a/application/controllers/admin/settings.php b/application/controllers/admin/settings.php index 0298810be1..84fae0e68e 100755 --- a/application/controllers/admin/settings.php +++ b/application/controllers/admin/settings.php @@ -63,6 +63,7 @@ public function site() 'allow_alerts' => '', 'allow_reports' => '', 'allow_comments' => '', + 'max_upload_size' => '', 'allow_feed' => '', 'allow_feed_category' => '', 'feed_geolocation_user' => '', @@ -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]'); @@ -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, diff --git a/application/controllers/admin/upgrade.php b/application/controllers/admin/upgrade.php index 9b6673a9e1..6c960a4acb 100644 --- a/application/controllers/admin/upgrade.php +++ b/application/controllers/admin/upgrade.php @@ -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) diff --git a/application/controllers/login.php b/application/controllers/login.php index df4c3d6e9f..c9f6085ad0 100644 --- a/application/controllers/login.php +++ b/application/controllers/login.php @@ -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')); @@ -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); @@ -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()) { @@ -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; } diff --git a/application/controllers/members/profile.php b/application/controllers/members/profile.php index 5c64fca73b..625ef95587 100644 --- a/application/controllers/members/profile.php +++ b/application/controllers/members/profile.php @@ -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); diff --git a/application/helpers/reports.php b/application/helpers/reports.php index 6d834e51c3..256b0095ab 100644 --- a/application/helpers/reports.php +++ b/application/helpers/reports.php @@ -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 diff --git a/application/models/user.php b/application/models/user.php index de0f05681b..6ef52ab967 100644 --- a/application/models/user.php +++ b/application/models/user.php @@ -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'); @@ -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 */ diff --git a/application/views/admin/settings/site.php b/application/views/admin/settings/site.php index f92e6a6002..7d06558b0a 100755 --- a/application/views/admin/settings/site.php +++ b/application/views/admin/settings/site.php @@ -134,6 +134,13 @@ + + +
"+e.attributes.description+"
");d.overflow=e.attributes.overflow||"auto";d=new OpenLayers.Feature(this,f,d);this.features.push(d);f=d.createMarker();null!=e.attributes.title&&null!=e.attributes.description&&f.events.register("click",d,this.markerClick);this.addMarker(f)}this.events.triggerEvent("loadend")},markerClick:function(a){var b=this==this.layer.selectedFeature;this.layer.selectedFeature= +b?null:this;for(var c=0,d=this.layer.map.popups.length;c