Subversion Repositories oidplus

Rev

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

Rev 1301 Rev 1303
Line 206... Line 206...
206
                        if ($remember_me) {
206
                        if ($remember_me) {
207
                                if (!OIDplus::baseConfig()->getValue('JWT_ALLOW_LOGIN_USER', true)) {
207
                                if (!OIDplus::baseConfig()->getValue('JWT_ALLOW_LOGIN_USER', true)) {
208
                                        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'));
209
                                }
209
                                }
210
                                $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);
211
                                $authSimulation = new OIDplusAuthContentStoreJWT();
211
                                $newAuthStore = new OIDplusAuthContentStoreJWT();
212
                                $authSimulation->raLoginEx($email, $loginfo);
-
 
213
                                $authSimulation->setValue('oidplus_generator', OIDplusAuthContentStoreJWT::JWT_GENERATOR_LOGIN);
212
                                $newAuthStore->setValue('oidplus_generator', OIDplusAuthContentStoreJWT::JWT_GENERATOR_LOGIN);
214
                                $authSimulation->setValue('exp', time()+$ttl); // JWT "exp" attribute
213
                                $newAuthStore->setValue('exp', time()+$ttl); // JWT "exp" attribute
215
                                $authSimulation->activate();
-
 
216
                        } else {
214
                        } else {
217
                                $authSimulation = new OIDplusAuthContentStoreSession();
215
                                $newAuthStore = new OIDplusAuthContentStoreSession();
218
                                $authSimulation->raLoginEx($email, $loginfo);
-
 
219
                                $authSimulation->activate();
-
 
220
                        }
216
                        }
-
 
217
                        $newAuthStore->raLoginEx($email, $loginfo);
-
 
218
                        $newAuthStore->activate();
221
                }
219
                }
222
                $logmsg = "RA '$email' logged in";
220
                $logmsg = "RA '$email' logged in";
223
                if ($origin != '') $logmsg .= " via $origin";
221
                if ($origin != '') $logmsg .= " via $origin";
224
                if ($loginfo != '') $logmsg .= " ($loginfo)";
222
                if ($loginfo != '') $logmsg .= " ($loginfo)";
225
                OIDplus::logger()->log("V2:[OK]RA(%1)", "%2", $email, $logmsg);
223
                OIDplus::logger()->log("V2:[OK]RA(%1)", "%2", $email, $logmsg);
Line 338... Line 336...
338
                        if ($remember_me) {
336
                        if ($remember_me) {
339
                                if (!OIDplus::baseConfig()->getValue('JWT_ALLOW_LOGIN_ADMIN', true)) {
337
                                if (!OIDplus::baseConfig()->getValue('JWT_ALLOW_LOGIN_ADMIN', true)) {
340
                                        throw new OIDplusException(_L('The administrator has disabled this feature. (Base configuration setting %1).','JWT_ALLOW_LOGIN_ADMIN'));
338
                                        throw new OIDplusException(_L('The administrator has disabled this feature. (Base configuration setting %1).','JWT_ALLOW_LOGIN_ADMIN'));
341
                                }
339
                                }
342
                                $ttl = OIDplus::baseConfig()->getValue('JWT_TTL_LOGIN_ADMIN', 10*365*24*60*60);
340
                                $ttl = OIDplus::baseConfig()->getValue('JWT_TTL_LOGIN_ADMIN', 10*365*24*60*60);
343
                                $authSimulation = new OIDplusAuthContentStoreJWT();
341
                                $newAuthStore = new OIDplusAuthContentStoreJWT();
344
                                $authSimulation->adminLoginEx($loginfo);
-
 
345
                                $authSimulation->setValue('oidplus_generator', OIDplusAuthContentStoreJWT::JWT_GENERATOR_LOGIN);
342
                                $newAuthStore->setValue('oidplus_generator', OIDplusAuthContentStoreJWT::JWT_GENERATOR_LOGIN);
346
                                $authSimulation->setValue('exp', time()+$ttl); // JWT "exp" attribute
343
                                $newAuthStore->setValue('exp', time()+$ttl); // JWT "exp" attribute
347
                                $authSimulation->activate();
-
 
348
                        } else {
344
                        } else {
349
                                $authSimulation = new OIDplusAuthContentStoreSession();
345
                                $newAuthStore = new OIDplusAuthContentStoreSession();
350
                                $authSimulation->adminLoginEx($loginfo);
-
 
351
                                $authSimulation->activate();
-
 
352
                        }
346
                        }
-
 
347
                        $newAuthStore->adminLoginEx($loginfo);
-
 
348
                        $newAuthStore->activate();
353
                }
349
                }
354
                $logmsg = "Admin logged in";
350
                $logmsg = "Admin logged in";
355
                if ($origin != '') $logmsg .= " via $origin";
351
                if ($origin != '') $logmsg .= " via $origin";
356
                if ($loginfo != '') $logmsg .= " ($loginfo)";
352
                if ($loginfo != '') $logmsg .= " ($loginfo)";
357
                OIDplus::logger()->log("V2:[OK]A", "%1", $logmsg);
353
                OIDplus::logger()->log("V2:[OK]A", "%1", $logmsg);