Permalink
Browse files

Fixes #15200: Anonymous access is broken.

  • Loading branch information...
1 parent 23b9476 commit d67c25724b409d79cdfe88f2381155b211eca277 @vboctor vboctor committed Nov 11, 2012
Showing with 9 additions and 4 deletions.
  1. +5 −1 core/html_api.php
  2. +4 −3 core/user_pref_api.php
View
@@ -548,7 +548,11 @@ function html_login_info() {
# User has only one project, set it as both current and default
if( ALL_PROJECTS == helper_get_current_project() ) {
helper_set_current_project( $t_project_id );
- current_user_set_default_project( $t_project_id );
+
+ if ( !current_user_is_protected() ) {
+ current_user_set_default_project( $t_project_id );
+ }
+
# Force reload of current page
$t_redirect_url = str_replace( config_get( 'short_path' ), '', $_SERVER['REQUEST_URI'] );
html_meta_redirect( $t_redirect_url, 0, false );
View
@@ -548,9 +548,10 @@ function user_pref_get_language( $p_user_id, $p_project_id = ALL_PROJECTS ) {
function user_pref_set_pref( $p_user_id, $p_pref_name, $p_pref_value, $p_project_id = ALL_PROJECTS ) {
$t_prefs = user_pref_get( $p_user_id, $p_project_id );
- $t_prefs->$p_pref_name = $p_pref_value;
-
- user_pref_set( $p_user_id, $t_prefs, $p_project_id );
+ if ( $t_prefs->$p_pref_name != $p_pref_value ) {
+ $t_prefs->$p_pref_name = $p_pref_value;
+ user_pref_set( $p_user_id, $t_prefs, $p_project_id );
+ }
return true;
}

0 comments on commit d67c257

Please sign in to comment.