diff --git a/access.php b/access.php index 24e0107ed..ccb0e8053 100644 --- a/access.php +++ b/access.php @@ -23,8 +23,7 @@ */ require_once 'includes/init.php'; -$allow_view_other = - ( ! empty( $ALLOW_VIEW_OTHER ) && $ALLOW_VIEW_OTHER == 'Y' ); +$allow_view_other = ( ( $ALLOW_VIEW_OTHER ??= 'Y' ) === 'Y' ); if( ! access_is_enabled() ) { echo print_not_auth(); @@ -46,11 +45,12 @@ // Are we handling the access form? // If so, do that, then redirect. // Handle function access first. -if( getPostValue( 'auser' ) != '' && getPostValue( 'submit' ) == $saveStr ) { +if ( getPostValue ( 'auser' ) !== '' && + getPostValue ( 'submit' ) === $saveStr ) { $auser = getPostValue( 'auser' ); $perm = ''; for( $i = 0; $i < ACCESS_NUMBER_FUNCTIONS; $i++ ) { - $perm .= ( getPostValue( 'access_' . $i ) == 'Y' ? 'Y' : 'N' ); + $perm .= ( getPostValue ( 'access_' . $i ) === 'Y' ? 'Y' : 'N' ); } dbi_execute( 'DELETE FROM webcal_access_function @@ -64,7 +64,8 @@ } // Are we handling the other user form? If so, do that, then redirect. -if( getPostValue( 'otheruser' ) != '' && getPostValue( 'submit' ) == $saveStr ) { +if ( getPostValue ( 'otheruser' ) !== '' && + getPostValue ( 'submit' ) === $saveStr ) { $puser = getPostValue( 'guser' ); $pouser = getPostValue( 'otheruser' ); @@ -98,8 +99,9 @@ $puser, $pouser, ( $view_total > 0 ? $view_total : 0 ), - ( $edit_total > 0 && $puser != '__public__' ? $edit_total : 0 ), - ( $approve_total > 0 && $puser != '__public__' ? $approve_total : 0 ), + ( $puser !== '__public__' && $edit_total > 0 ? $edit_total : 0 ), + ( $puser !== '__public__' && $approve_total > 0 + ? $approve_total : 0 ), ( strlen( $invite ) ? $invite : 'N' ), ( strlen( $email ) ? $email : 'N' ), ( strlen( $time ) ? $time : 'N' )] ) ) @@ -112,16 +114,16 @@ $guser = getPostValue( 'guser' ); $selected = ' selected'; -if( $guser == '__default__' ) { +if ( $guser === '__default__' ) { $otheruser = $guser; $user_fullname = $defConfigStr; } else $otheruser = getPostValue( 'otheruser' ); -if( $otheruser == '__default__' ) { +if ( $otheruser === '__default__' ) { $otheruser_fullname = $defConfigStr; $otheruser_login = '__default__'; -} elseif( $otheruser == '__public__' ) { +} elseif ( $otheruser === '__public__' ) { $otheruser_fullname = translate( 'Public Access' ); $otheruser_login = '__public__'; } @@ -181,20 +183,20 @@ // Add a DEFAULT CONFIGURATION to be used as a mask. . ' '; for( $i = 0, $cnt = count( $userlist ); $i < $cnt; $i++ ) { echo ' '; } for( $i = 0, $cnt = count( $nonuserlist ); $i < $cnt; $i++ ) { echo ' '; + . ( $nonuserlist[$i]['cal_is_public'] === 'Y' ? '*' : '' ) . ''; } echo $goStr; @@ -210,7 +212,7 @@ $order = array_merge ( [1, 0], range ( 2, 14 ), [27], range ( 15, 26 ) ); // Make sure that we have defined all the types of access // defined in access.php. - assert( count( $order ) == ACCESS_NUMBER_FUNCTIONS ); + assert ( count ( $order ) === ACCESS_NUMBER_FUNCTIONS ); echo '