1: <?php
2:
3: /**
4: * This file contains the abstract authentication handler class.
5: *
6: * @package Core
7: * @subpackage Authentication
8: * @author Dominik Ziegler
9: * @copyright four for business AG <www.4fb.de>
10: * @license http://www.contenido.org/license/LIZENZ.txt
11: * @link http://www.4fb.de
12: * @link http://www.contenido.org
13: */
14:
15: defined('CON_FRAMEWORK') || die('Illegal call: Missing framework initialization - request aborted.');
16:
17: /**
18: * This class is the abstract authentication handler for CONTENIDO
19: * which may be extended differently for frontend and backend authentication.
20: *
21: * @package Core
22: * @subpackage Authentication
23: */
24: abstract class cAuthHandlerAbstract extends cAuth {
25:
26: /**
27: * Handle the pre authorization.
28: *
29: * When implementing this method let it return a valid user ID to be
30: * set before the login form is handled, otherwise false.
31: *
32: * @todo should be named preAuth or preAuthenticate
33: * @return string|false
34: */
35: abstract public function preAuthorize();
36:
37: /**
38: * Display the login form.
39: *
40: * When implementing this method let this method include a file
41: * which displays the login form.
42: */
43: abstract public function displayLoginForm();
44:
45: /**
46: * Validate the credentials.
47: *
48: * When implementing this method let this method validate the users
49: * input against source and return a valid user ID or false.
50: *
51: * @return string|false
52: */
53: abstract public function validateCredentials();
54:
55: /**
56: * Log a successful authentication.
57: * This method can be executed to log a successful login.
58: */
59: abstract public function logSuccessfulAuth();
60:
61:
62: /**
63: * Returns true if a user is logged in
64: *
65: * @return bool
66: */
67: abstract public function isLoggedIn();
68:
69: }
70: