Przeglądaj źródła

No sessions on the CLI

Zachary Kotlarek 12 lat temu
rodzic
commit
61efaace50
1 zmienionych plików z 4 dodań i 2 usunięć
  1. 4 2
      web/includes/auth.php

+ 4 - 2
web/includes/auth.php

@@ -1,7 +1,9 @@
 <?
 
-# Always start a session
-session_start();
+# Always start a session, unless we're on the CLI
+if (php_sapi_name() != 'cli') {
+	session_start();
+}
 
 function login($username, $password) {
 	global $PAM_SERVICE;