diff --git a/web/includes/actions.php b/web/includes/actions.php index 6b94b7c68..1c3f2b727 100644 --- a/web/includes/actions.php +++ b/web/includes/actions.php @@ -55,9 +55,14 @@ function getAffectedIds( $name ) { return( $ids ); } -if ( ZM_OPT_USE_AUTH && ZM_AUTH_HASH_LOGINS && empty($user) && !empty($_REQUEST['auth']) ) { - if ( $authUser = getAuthUser( $_REQUEST['auth'] ) ) { - userLogin( $authUser['Username'], $authUser['Password'], true ); +if ( ZM_OPT_USE_AUTH && ZM_AUTH_HASH_LOGINS ) { + if ( empty($user) && !empty($_REQUEST['auth']) ) { + if ( $authUser = getAuthUser( $_REQUEST['auth'] ) ) { + userLogin( $authUser['Username'], $authUser['Password'], true ); + } + } else { + // generate it once here, while session is open. Value will be cached in session and return when called later on + generateAuthHash( ZM_AUTH_HASH_IPS ); } }