Core  3.2
PHP API documentation
 All Data Structures Namespaces Files Functions Variables Pages
Class.Provider.php
Go to the documentation of this file.
1 <?php
2 /*
3  * @author Anakeen
4  * @package FDL
5 */
6 /**
7  * provider abstract class
8  *
9  * @author Anakeen
10  * @version $Id: $
11  * @package FDL
12  */
13 /**
14  */
15 /**
16  * Class Provider
17  * @method initializeUser
18  */
19 abstract class Provider
20 {
21 
22  public $parms;
23  public $pname;
24  public $errno;
25 
26  const ERRNO_BUG_639 = 1;
27 
28  public function __construct($authprovider, $parms)
29  {
30  $this->parms = $parms;
31  $this->pname = strtolower($authprovider);
32  $this->errno = 0;
33  }
34 
35  abstract function validateCredential($username, $password);
36 
37  public function validateAuthorization($opt)
38  {
39  return true;
40  }
41 
42  public function canICreateUser()
43  {
44  if (array_key_exists('allowAutoFreedomUserCreation', $this->parms) && strtolower($this->parms{'allowAutoFreedomUserCreation'}) == 'yes' && is_callable(array(
45  $this,
46  'initializeUser'
47  ))) {
48  $this->errno = 0;
49  return TRUE;
50  }
51  $this->errno = 0;
52  return FALSE;
53  }
54 }
__construct($authprovider, $parms)
validateAuthorization($opt)
validateCredential($username, $password)
const ERRNO_BUG_639
← centre documentaire © anakeen