Rev 1288 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1288 | Rev 1293 | ||
---|---|---|---|
Line 115... | Line 115... | ||
115 | } |
115 | } |
116 | return -1; |
116 | return -1; |
117 | } |
117 | } |
118 | 118 | ||
119 | /** |
119 | /** |
120 | * @param string $actionID |
- | |
121 | * @param array $params |
120 | * @param array $params |
122 | * @return array |
121 | * @return array |
123 | * @throws OIDplusConfigInitializationException |
122 | * @throws OIDplusConfigInitializationException |
124 | * @throws OIDplusException |
123 | * @throws OIDplusException |
125 | */ |
124 | */ |
126 | public function action(string $actionID, array $params): array { |
125 | private function action_Login(array $params): array { |
127 | if ($actionID == 'ra_login_ldap') { |
- | |
128 | if (!OIDplus::baseConfig()->getValue('LDAP_ENABLED', false)) { |
126 | if (!OIDplus::baseConfig()->getValue('LDAP_ENABLED', false)) { |
129 | throw new OIDplusException(_L('LDAP authentication is disabled on this system.')); |
127 | throw new OIDplusException(_L('LDAP authentication is disabled on this system.')); |
130 | } |
128 | } |
131 | 129 | ||
132 | if (!function_exists('ldap_connect')) throw new OIDplusConfigInitializationException(_L('PHP extension "%1" not installed','LDAP')); |
130 | if (!function_exists('ldap_connect')) throw new OIDplusConfigInitializationException(_L('PHP extension "%1" not installed','LDAP')); |
Line 222... | Line 220... | ||
222 | if (!$foundSomething) { |
220 | if (!$foundSomething) { |
223 | throw new OIDplusException(_L("Error: These credentials cannot be used with OIDplus. Please check the base configuration.")); |
221 | throw new OIDplusException(_L("Error: These credentials cannot be used with OIDplus. Please check the base configuration.")); |
224 | } |
222 | } |
225 | 223 | ||
226 | return array("status" => 0); |
224 | return array("status" => 0); |
- | 225 | } |
|
- | 226 | ||
- | 227 | /** |
|
- | 228 | * @param string $actionID |
|
- | 229 | * @param array $params |
|
- | 230 | * @return array |
|
- | 231 | * @throws OIDplusConfigInitializationException |
|
- | 232 | * @throws OIDplusException |
|
- | 233 | */ |
|
- | 234 | public function action(string $actionID, array $params): array { |
|
- | 235 | if ($actionID == 'ra_login_ldap') { |
|
- | 236 | return $this->action_Login($params); |
|
227 | } else { |
237 | } else { |
228 | return parent::action($actionID, $params); |
238 | return parent::action($actionID, $params); |
229 | } |
239 | } |
230 | } |
240 | } |
231 | 241 |