Revision 43
Added by stefan about 20 years ago
| class.login.php | ||
|---|---|---|
| 61 | 61 |
$this->forgotten_details_app = $config_array['FORGOTTEN_DETAILS_APP']; |
| 62 | 62 |
$this->max_username_len = $config_array['MAX_USERNAME_LEN']; |
| 63 | 63 |
$this->max_password_len = $config_array['MAX_PASSWORD_LEN']; |
| 64 |
$this->redirect_url = $config_array['REDIRECT_URL']; |
|
| 64 | 65 |
// Get the supplied username and password |
| 65 | 66 |
if ($this->get_post('username_fieldname') != ''){
|
| 66 | 67 |
$username_fieldname = $this->get_post('username_fieldname');
|
| ... | ... | |
| 84 | 85 |
} |
| 85 | 86 |
// If the url is blank, set it to the default url |
| 86 | 87 |
$this->url = $this->get_post('url');
|
| 88 |
if ($this->redirect_url!='') {
|
|
| 89 |
$this->url = $this->redirect_url; |
|
| 90 |
} |
|
| 87 | 91 |
if(strlen($this->url) < 2) {
|
| 88 | 92 |
$this->url = $config_array['DEFAULT_URL']; |
| 89 | 93 |
} |
| 90 |
// Login the user |
|
| 91 | 94 |
if($this->is_authenticated() == true) {
|
| 92 | 95 |
// User already logged-in, so redirect to default url |
| 93 | 96 |
header('Location: '.$this->url);
|
| ... | ... | |
| 134 | 137 |
$this->password = md5($this->password); |
| 135 | 138 |
if($this->authenticate()) {
|
| 136 | 139 |
// Authentication successful |
| 140 |
//echo $this->url;exit(); |
|
| 137 | 141 |
header("Location: ".$this->url);
|
| 138 | 142 |
} else {
|
| 139 | 143 |
$this->message = $MESSAGE['LOGIN']['AUTHENTICATION_FAILED']; |
Also available in: Unified diff
Added automatic frontend redirection on login.