Prechádzať zdrojové kódy

fix auth by project

Piotr Labudda 6 rokov pred
rodič
commit
1a9970fbec
1 zmenil súbory, kde vykonal 2 pridanie a 2 odobranie
  1. 2 2
      SE/se-lib/User.php

+ 2 - 2
SE/se-lib/User.php

@@ -359,7 +359,7 @@ class User {
 			$pathAuthClass = $projectPath ? "{$projectPath}/auth.php" : null;
 			$pathAuthClass = $projectPath ? "{$projectPath}/auth.php" : null;
 			if ($pathAuthClass && file_exists($pathAuthClass)) {
 			if ($pathAuthClass && file_exists($pathAuthClass)) {
 				require_once $pathAuthClass;
 				require_once $pathAuthClass;
-				$nameAuthClass = "Auth_{$projectName}";
+				$nameAuthClass = "Theme_Auth_{$projectName}";
 				if (!class_exists($nameAuthClass)) throw new Exception("Auth class not exists for project '{$projectName}'!");
 				if (!class_exists($nameAuthClass)) throw new Exception("Auth class not exists for project '{$projectName}'!");
 				$authClass = $nameAuthClass;
 				$authClass = $nameAuthClass;
 			}
 			}
@@ -377,7 +377,7 @@ class User {
 		} else if ($authClass) {
 		} else if ($authClass) {
 			// $classname::aStaticMethod(); // As of PHP 5.3.0
 			// $classname::aStaticMethod(); // As of PHP 5.3.0
 			$user = $authClass::login($login, $pass);
 			$user = $authClass::login($login, $pass);
-			{ // default values
+			if ($user) { // default values
 				if (!$user->EMAIL_IMAP_IMPORT_HOST) $user->EMAIL_IMAP_IMPORT_HOST = null;
 				if (!$user->EMAIL_IMAP_IMPORT_HOST) $user->EMAIL_IMAP_IMPORT_HOST = null;
 				if (!$user->EMAIL_IMAP_IMPORT_USERNAME) $user->EMAIL_IMAP_IMPORT_USERNAME = null;
 				if (!$user->EMAIL_IMAP_IMPORT_USERNAME) $user->EMAIL_IMAP_IMPORT_USERNAME = null;
 			}
 			}