Subversion Repositories oidplus

Rev

Rev 1300 | Rev 1303 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1300 Rev 1301
Line 196... Line 196...
196
         */
196
         */
197
        public function raLoginEx(string $email, bool $remember_me, string $origin='') {
197
        public function raLoginEx(string $email, bool $remember_me, string $origin='') {
198
                $loginfo = '';
198
                $loginfo = '';
199
                $acs = $this->getAuthContentStore();
199
                $acs = $this->getAuthContentStore();
200
                if (!is_null($acs)) {
200
                if (!is_null($acs)) {
-
 
201
                        // User is already logged in (a session or JWT exists), so we modify their login status
201
                        $acs->raLoginEx($email, $loginfo);
202
                        $acs->raLoginEx($email, $loginfo);
202
                        $acs->activate();
203
                        $acs->activate();
203
                } else {
204
                } else {
-
 
205
                        // No user is logged in (no session or JWT exists). We now create a auth content store and activate it (cookies will be set etc.)
204
                        if ($remember_me) {
206
                        if ($remember_me) {
205
                                if (!OIDplus::baseConfig()->getValue('JWT_ALLOW_LOGIN_USER', true)) {
207
                                if (!OIDplus::baseConfig()->getValue('JWT_ALLOW_LOGIN_USER', true)) {
206
                                        throw new OIDplusException(_L('The administrator has disabled this feature. (Base configuration setting %1).','JWT_ALLOW_LOGIN_USER'));
208
                                        throw new OIDplusException(_L('The administrator has disabled this feature. (Base configuration setting %1).','JWT_ALLOW_LOGIN_USER'));
207
                                }
209
                                }
208
                                $ttl = OIDplus::baseConfig()->getValue('JWT_TTL_LOGIN_USER', 10*365*24*60*60);
210
                                $ttl = OIDplus::baseConfig()->getValue('JWT_TTL_LOGIN_USER', 10*365*24*60*60);
Line 326... Line 328...
326
         */
328
         */
327
        public function adminLoginEx(bool $remember_me, string $origin='') {
329
        public function adminLoginEx(bool $remember_me, string $origin='') {
328
                $loginfo = '';
330
                $loginfo = '';
329
                $acs = $this->getAuthContentStore();
331
                $acs = $this->getAuthContentStore();
330
                if (!is_null($acs)) {
332
                if (!is_null($acs)) {
-
 
333
                        // User is already logged in (a session or JWT exists), so we modify their login status
331
                        $acs->adminLoginEx($loginfo);
334
                        $acs->adminLoginEx($loginfo);
332
                        $acs->activate();
335
                        $acs->activate();
333
                } else {
336
                } else {
-
 
337
                        // No user is logged in (no session or JWT exists). We now create a auth content store and activate it (cookies will be set etc.)
334
                        if ($remember_me) {
338
                        if ($remember_me) {
335
                                if (!OIDplus::baseConfig()->getValue('JWT_ALLOW_LOGIN_ADMIN', true)) {
339
                                if (!OIDplus::baseConfig()->getValue('JWT_ALLOW_LOGIN_ADMIN', true)) {
336
                                        throw new OIDplusException(_L('The administrator has disabled this feature. (Base configuration setting %1).','JWT_ALLOW_LOGIN_ADMIN'));
340
                                        throw new OIDplusException(_L('The administrator has disabled this feature. (Base configuration setting %1).','JWT_ALLOW_LOGIN_ADMIN'));
337
                                }
341
                                }
338
                                $ttl = OIDplus::baseConfig()->getValue('JWT_TTL_LOGIN_ADMIN', 10*365*24*60*60);
342
                                $ttl = OIDplus::baseConfig()->getValue('JWT_TTL_LOGIN_ADMIN', 10*365*24*60*60);