Rev 1267 | Rev 1283 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1267 | Rev 1282 | ||
---|---|---|---|
Line 45... | Line 45... | ||
45 | $this->inviteSecurityCheck($email); |
45 | $this->inviteSecurityCheck($email); |
46 | // TODO: should we also log who has invited? |
46 | // TODO: should we also log who has invited? |
47 | OIDplus::logger()->log("V2:[INFO]RA(%1)", "RA '%1' has been invited", $email); |
47 | OIDplus::logger()->log("V2:[INFO]RA(%1)", "RA '%1' has been invited", $email); |
48 | 48 | ||
49 | $timestamp = time(); |
49 | $timestamp = time(); |
50 | $activate_url = OIDplus::webpath(null,OIDplus::PATH_ABSOLUTE_CANONICAL) . '?goto='.urlencode('oidplus:activate_ra$'.$email.'$'.$timestamp.'$'.OIDplus::authUtils()->makeAuthKey('activate_ra;'.$email.';'.$timestamp)); |
50 | $activate_url = OIDplus::webpath(null,OIDplus::PATH_ABSOLUTE_CANONICAL) . '?goto='.urlencode('oidplus:activate_ra$'.$email.'$'.$timestamp.'$'.OIDplus::authUtils()->makeAuthKey('ed840c3e-f4fa-11ed-b67e-3c4a92df8582:'.$email.'/'.$timestamp)); |
51 | 51 | ||
52 | $message = $this->getInvitationText($email); |
52 | $message = $this->getInvitationText($email); |
53 | $message = str_replace('{{ACTIVATE_URL}}', $activate_url, $message); |
53 | $message = str_replace('{{ACTIVATE_URL}}', $activate_url, $message); |
54 | 54 | ||
55 | OIDplus::mailUtils()->sendMail($email, OIDplus::config()->getValue('system_title').' - Invitation', $message); |
55 | OIDplus::mailUtils()->sendMail($email, OIDplus::config()->getValue('system_title').' - Invitation', $message); |
Line 68... | Line 68... | ||
68 | $password2 = $params['password2']; |
68 | $password2 = $params['password2']; |
69 | $email = $params['email']; |
69 | $email = $params['email']; |
70 | $auth = $params['auth']; |
70 | $auth = $params['auth']; |
71 | $timestamp = $params['timestamp']; |
71 | $timestamp = $params['timestamp']; |
72 | 72 | ||
73 | if (!OIDplus::authUtils()->validateAuthKey('activate_ra;'.$email.';'.$timestamp, $auth)) { |
73 | if (!OIDplus::authUtils()->validateAuthKey('ed840c3e-f4fa-11ed-b67e-3c4a92df8582:'.$email.'/'.$timestamp, $auth)) { |
74 | throw new OIDplusException(_L('Invalid auth key')); |
74 | throw new OIDplusException(_L('Invalid auth key')); |
75 | } |
75 | } |
76 | 76 | ||
77 | if ((OIDplus::config()->getValue('max_ra_invite_time') > 0) && (time()-$timestamp > OIDplus::config()->getValue('max_ra_invite_time'))) { |
77 | if ((OIDplus::config()->getValue('max_ra_invite_time') > 0) && (time()-$timestamp > OIDplus::config()->getValue('max_ra_invite_time'))) { |
78 | throw new OIDplusException(_L('Invitation expired!')); |
78 | throw new OIDplusException(_L('Invitation expired!')); |