File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed
Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change 3535 * along with this program. If not, see <http://www.gnu.org/licenses/>
3636 *
3737 */
38+
39+ use OC \User \LoginException ;
3840use OCP \EventDispatcher \IEventDispatcher ;
3941use OCP \ILogger ;
4042use OCP \IUserManager ;
@@ -170,6 +172,10 @@ public static function loginWithApache(\OCP\Authentication\IApacheBackend $backe
170172 if (self ::getUser () !== $ uid ) {
171173 self ::setUserId ($ uid );
172174 $ userSession = \OC ::$ server ->getUserSession ();
175+ if ($ userSession ->getUser () && !$ userSession ->getUser ()->isEnabled ()) {
176+ $ message = \OC ::$ server ->getL10N ('lib ' )->t ('User disabled ' );
177+ throw new LoginException ($ message );
178+ }
173179 $ userSession ->setLoginName ($ uid );
174180 $ request = OC ::$ server ->getRequest ();
175181 $ userSession ->createSessionToken ($ request , $ uid , $ uid );
You can’t perform that action at this time.
0 commit comments