18 import(
'lib.pkp.classes.security.AuthSource');
27 parent::__construct();
40 $plugin = $auth->getPluginClass();
41 if ($plugin !=
null) {
42 $plugin = $plugin->getInstance($auth->getSettings(), $auth->getAuthId());
56 $plugin = $auth->getPluginClass();
57 if ($plugin !=
null) {
58 $plugin = $plugin->getInstance($auth->getSettings(), $auth->getAuthId());
71 'SELECT * FROM auth_sources WHERE auth_id = ?',
76 if ($result->RecordCount() != 0) {
77 $returner = $this->
_fromRow($result->GetRowAssoc(
false));
90 'SELECT * FROM auth_sources WHERE auth_default = 1'
94 if ($result->RecordCount() != 0) {
95 $returner = $this->
_fromRow($result->GetRowAssoc(
false));
117 $auth->setAuthId($row[
'auth_id']);
118 $auth->setTitle($row[
'title']);
119 $auth->setPlugin($row[
'plugin']);
120 $auth->setPluginClass(@$this->
plugins[$row[
'plugin']]);
121 $auth->setDefault($row[
'auth_default']);
122 $auth->setSettings(unserialize($row[
'settings']));
131 if (!isset($this->
plugins[$auth->getPlugin()]))
return false;
132 if (!$auth->getTitle()) $auth->setTitle($this->
plugins[$auth->getPlugin()]->getDisplayName());
134 'INSERT INTO auth_sources
135 (title, plugin, settings)
141 serialize($auth->getSettings() ? $auth->getSettings() : array())
145 $auth->setAuthId($this->
_getInsertId(
'auth_sources',
'auth_id'));
146 return $auth->getAuthId();
155 'UPDATE auth_sources SET
161 serialize($auth->getSettings() ? $auth->getSettings() : array()),
162 (
int) $auth->getAuthId()
173 'DELETE FROM auth_sources WHERE auth_id = ?', $authId
183 'UPDATE auth_sources SET auth_default = 0'
186 'UPDATE auth_sources SET auth_default = 1 WHERE auth_id = ?',
197 'SELECT * FROM auth_sources ORDER BY auth_id',