00001 <?php
00002
00018
00019
00020 define('AUTH_PLUGIN_CATEGORY', 'auth');
00021
00022 class AuthPlugin extends Plugin {
00023
00025 var $settings;
00026
00028 var $authId;
00029
00034 function AuthPlugin($settings = array(), $authId = null) {
00035 parent::Plugin();
00036 $this->settings = $settings;
00037 $this->authId = $authId;
00038 }
00039
00040
00041
00042
00043
00044
00050 function getName() {
00051 return 'auth';
00052 }
00053
00059 function getDisplayName() {
00060 return 'Abstract Authentication Plugin';
00061 }
00062
00068 function getDescription() {
00069 'Authentication plugin base class';
00070 }
00071
00077 function getSettingsTemplate() {
00078 return $this->getTemplatePath() . 'settings.tpl';
00079 }
00080
00081
00082
00083
00084
00085
00091 function doGetUserInfo(&$user) {
00092 if (isset($this->settings['syncProfiles'])) {
00093 return $this->getUserInfo($user);
00094 }
00095 return false;
00096 }
00097
00103 function doSetUserInfo(&$user) {
00104 if (isset($this->settings['syncProfiles'])) {
00105 return $this->setUserInfo($user);
00106 }
00107 return false;
00108 }
00109
00116 function doSetUserPassword($username, $password) {
00117 if (isset($this->settings['syncPasswords'])) {
00118 return $this->setUserPassword($username, $password);
00119 }
00120 return false;
00121 }
00122
00128 function doCreateUser(&$user) {
00129 if (isset($this->settings['createUsers'])) {
00130 return $this->createUser($user);
00131 }
00132 return false;
00133 }
00134
00135
00136
00137
00138
00139
00140
00147 function &getInstance($settings, $authId) {
00148 $returner = null;
00149 return $returner;
00150 }
00151
00158 function authenticate($username, $password) {
00159 return false;
00160 }
00161
00162
00163
00164
00165
00166
00167
00173 function userExists($username) {
00174 return false;
00175 }
00176
00183 function getUserInfo(&$user) {
00184 return false;
00185 }
00186
00192 function setUserInfo(&$user) {
00193 return false;
00194 }
00195
00202 function setUserPassword($username, $password) {
00203 return false;
00204 }
00205
00211 function createUser(&$user) {
00212 return false;
00213 }
00214
00222 function deleteUser($username) {
00223 return false;
00224 }
00225
00229 function isSitePlugin() {
00230 return true;
00231 }
00232
00236 function getManagementVerbs() {
00237 return array(
00238 array(
00239 'authSources',
00240 __('admin.authSources')
00241 )
00242 );
00243 }
00244
00245 function manage($verb, $args) {
00246 if ($verb === 'authSources') {
00247 Request::redirect('index', 'index', ROLE_PATH_SITE_ADMIN, 'auth');
00248 }
00249 return false;
00250 }
00251 }
00252
00253 ?>