Skip to content

Commit

Permalink
Fixes #15200: Anonymous access is broken.
Browse files Browse the repository at this point in the history
  • Loading branch information
vboctor authored and dregad committed Nov 11, 2012
1 parent f46b71f commit df10eff
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
6 changes: 5 additions & 1 deletion core/html_api.php
Expand Up @@ -580,7 +580,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 );
Expand Down
7 changes: 4 additions & 3 deletions core/user_pref_api.php
Expand Up @@ -567,9 +567,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;
}
Expand Down

0 comments on commit df10eff

Please sign in to comment.