mirror of
				https://git.code.sf.net/p/seeddms/code
				synced 2025-10-31 05:11:27 +00:00 
			
		
		
		
	use authentication service
This commit is contained in:
		
							parent
							
								
									a5e975caa5
								
							
						
					
					
						commit
						55df94a993
					
				|  | @ -232,6 +232,7 @@ class RestapiController { /* {{{ */ | ||||||
|         $dms = $this->container->dms; |         $dms = $this->container->dms; | ||||||
|         $settings = $this->container->config; |         $settings = $this->container->config; | ||||||
|         $logger = $this->container->logger; |         $logger = $this->container->logger; | ||||||
|  |         $authenticator = $this->container->authenticator; | ||||||
| 
 | 
 | ||||||
|         $params = $request->getParsedBody(); |         $params = $request->getParsedBody(); | ||||||
|         if(empty($params['user']) || empty($params['pass'])) { |         if(empty($params['user']) || empty($params['pass'])) { | ||||||
|  | @ -240,23 +241,7 @@ class RestapiController { /* {{{ */ | ||||||
|         } |         } | ||||||
|         $username = $params['user']; |         $username = $params['user']; | ||||||
|         $password = $params['pass']; |         $password = $params['pass']; | ||||||
| 
 |         $userobj = $authenticator->authenticate($username, $password); | ||||||
|     //    $userobj = $dms->getUserByLogin($username);
 |  | ||||||
|         $userobj = null; |  | ||||||
| 
 |  | ||||||
|         /* Authenticate against LDAP server {{{ */ |  | ||||||
|         if (!$userobj && isset($settings->_ldapHost) && strlen($settings->_ldapHost)>0) { |  | ||||||
|             require_once("../inc/inc.ClassLdapAuthentication.php"); |  | ||||||
|             $authobj = new SeedDMS_LdapAuthentication($dms, $settings); |  | ||||||
|             $userobj = $authobj->authenticate($username, $password); |  | ||||||
|         } /* }}} */ |  | ||||||
| 
 |  | ||||||
|         /* Authenticate against SeedDMS database {{{ */ |  | ||||||
|         if(!$userobj) { |  | ||||||
|             require_once("../inc/inc.ClassDbAuthentication.php"); |  | ||||||
|             $authobj = new SeedDMS_DbAuthentication($dms, $settings); |  | ||||||
|             $userobj = $authobj->authenticate($username, $password); |  | ||||||
|         } /* }}} */ |  | ||||||
| 
 | 
 | ||||||
|         if(!$userobj) { |         if(!$userobj) { | ||||||
|             setcookie("mydms_session", '', time()-3600, $settings->_httpRoot); |             setcookie("mydms_session", '', time()-3600, $settings->_httpRoot); | ||||||
|  | @ -2712,6 +2697,7 @@ $container['conversionmgr'] = $conversionmgr; | ||||||
| $container['logger'] = $logger; | $container['logger'] = $logger; | ||||||
| $container['fulltextservice'] = $fulltextservice; | $container['fulltextservice'] = $fulltextservice; | ||||||
| $container['notifier'] = $notifier; | $container['notifier'] = $notifier; | ||||||
|  | $container['authenticator'] = $authenticator; | ||||||
| $app->add(new Auth($container)); | $app->add(new Auth($container)); | ||||||
| 
 | 
 | ||||||
| // Make CORS preflighted request possible
 | // Make CORS preflighted request possible
 | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 Uwe Steinmann
						Uwe Steinmann