AuthSource.php

Go to the documentation of this file.
00001 <?php
00003 // {{{ license
00004 
00005 // +----------------------------------------------------------------------+
00006 // | FastFrame Application Framework                                      |
00007 // +----------------------------------------------------------------------+
00008 // | Copyright (c) 2002-2006 The Codejanitor Group                        |
00009 // +----------------------------------------------------------------------+
00010 // | This source file is subject to the GNU Lesser Public License (LGPL), |
00011 // | that is bundled with this package in the file LICENSE, and is        |
00012 // | available at through the world-wide-web at                           |
00013 // | http://www.fsf.org/copyleft/lesser.html                              |
00014 // | If you did not receive a copy of the LGPL and are unable to          |
00015 // | obtain it through the world-wide-web, you can get it by writing the  |
00016 // | Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, |
00017 // | MA 02111-1307, USA.                                                  |
00018 // +----------------------------------------------------------------------+
00019 // | Authors: Greg Gilbert <greg@treke.net>                               |
00020 // +----------------------------------------------------------------------+
00021 
00022 // }}}
00023 // {{{ class  FF_AuthSource
00024 
00034 // }}}
00035 class FF_AuthSource {
00036     // {{{ properties
00037 
00042     var $name;
00043 
00048     var $serverName;
00049 
00054     var $capabilities = array(
00055             'resetpassword' => false,
00056             'updateusername' => false,
00057             'transparent' => false);
00058 
00063     var $o_result;
00064 
00065     // }}}
00066     // {{{ constructor
00067     
00077     function FF_AuthSource($in_name, $in_params)
00078     {
00079         $this->name = $in_name;
00080         $this->o_result = new FF_Result();
00081         $this->o_result->setSuccess(false);
00082     }
00083 
00084     // }}}
00085     // {{{ factory()
00086 
00102     function &factory($in_type, $in_name, $in_params)
00103     {
00104         $pth_authFile = dirname(__FILE__) . '/' . $in_type . '.php';
00105         if (!file_exists($pth_authFile)) {
00106             $o_auth =& new FF_AuthSource($in_name, $in_params);
00107             return $o_auth;
00108         }
00109 
00110         require_once $pth_authFile;
00111         $s_authClass = 'FF_AuthSource_' . $in_type;
00112         $o_auth =& new $s_authClass($in_name, $in_params);
00113         return $o_auth;
00114     }
00115 
00116     // }}}
00117     // {{{ authenticate()
00118 
00125     function authenticate($username, $password)
00126     {
00127         return $this->o_result;
00128     }
00129 
00130     // }}}
00131     // {{{ transparent()
00132 
00139     function transparent()
00140     {
00141         return false;
00142     }
00143 
00144     // }}}
00145     // {{{ getName()
00146 
00153     function getName()
00154     {
00155         return $this->name;
00156     }
00157 
00158     // }}}
00159     // {{{ getServerName()
00160 
00167     function getServerName()
00168     {
00169         return $this->serverName;
00170     }
00171 
00172     // }}}
00173     // {{{ hasCapability()
00174 
00183     function hasCapability($in_name)
00184     {
00185         return $this->capabilities[$in_name];
00186     }
00187 
00188     // }}}
00189     // {{{ updatePassword()
00190 
00200     function updatePassword($in_userId, $in_newPassword)
00201     {
00202         // interface
00203     }
00204 
00205     // }}}
00206     // {{{ updateUserName()
00207 
00217     function updateUserName($in_userId, $in_newUserName)
00218     {
00219         // interface
00220     }
00221 
00222     // }}}
00223 }
00224 ?>

Generated on Fri Jun 23 11:38:15 2006 for FastFrame by  doxygen 1.4.4