Minor - fixing PHP warnings.
shared and chat folders are filtered depending the sesion see BT#8074