Platform  3.1
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  * @license http://creativecommons.org/licenses/by-nc-sa/2.0/fr/ Anakeen - licence CC
5  * @package FDL
6 */
7 /**
8  * provider abstract class
9  *
10  * @author Anakeen 2009
11  * @version $Id: $
12  * @license http://creativecommons.org/licenses/by-nc-sa/2.0/fr/ Anakeen - licence CC
13  * @package FDL
14  */
15 /**
16  */
17 
18 abstract class Provider
19 {
20 
21  public $parms;
22  public $pname;
23  public $errno;
24 
25  const ERRNO_BUG_639 = 1;
26 
27  public function __construct($authprovider, $parms)
28  {
29  $this->parms = $parms;
30  $this->pname = strtolower($authprovider);
31  $this->errno = 0;
32  }
33 
34  abstract function validateCredential($username, $password);
35  abstract function validateAuthorization($opt);
36 
37  public function canICreateUser()
38  {
39  if (array_key_exists('allowAutoFreedomUserCreation', $this->parms) && strtolower($this->parms{'allowAutoFreedomUserCreation'}) == 'yes' && is_callable(array(
40  $this,
41  'initializeUser'
42  ))) {
43  $this->errno = 0;
44  return TRUE;
45  }
46  $this->errno = 0;
47  return FALSE;
48  }
49 }
50 ?>
← centre documentaire © anakeen - published under CC License - Dynacase