Subversion Repositories oidplus

Rev

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 80... Line 80...
80
 
80
 
81
                        $root_oid = self::getFreeRootOid(false);
81
                        $root_oid = self::getFreeRootOid(false);
82
                        OIDplus::logger()->log("V2:[INFO]OID(oid:%1)+RA(%2)", "Requested a free OID for email '%2' to be placed into root '%1'", $root_oid, $email);
82
                        OIDplus::logger()->log("V2:[INFO]OID(oid:%1)+RA(%2)", "Requested a free OID for email '%2' to be placed into root '%1'", $root_oid, $email);
83
 
83
 
84
                        $timestamp = time();
84
                        $timestamp = time();
85
                        $activate_url = OIDplus::webpath(null,OIDplus::PATH_ABSOLUTE_CANONICAL) . '?goto='.urlencode('oidplus:com.viathinksoft.freeoid.activate_freeoid$'.$email.'$'.$timestamp.'$'.OIDplus::authUtils()->makeAuthKey('com.viathinksoft.freeoid.activate_freeoid;'.$email.';'.$timestamp));
85
                        $activate_url = OIDplus::webpath(null,OIDplus::PATH_ABSOLUTE_CANONICAL) . '?goto='.urlencode('oidplus:com.viathinksoft.freeoid.activate_freeoid$'.$email.'$'.$timestamp.'$'.OIDplus::authUtils()->makeAuthKey('40c87e20-f4fb-11ed-86ca-3c4a92df8582:'.$email.'/'.$timestamp));
86
 
86
 
87
                        $message = file_get_contents(__DIR__ . '/request_msg.tpl');
87
                        $message = file_get_contents(__DIR__ . '/request_msg.tpl');
88
                        $message = str_replace('{{SYSTEM_URL}}', OIDplus::webpath(null,OIDplus::PATH_ABSOLUTE_CANONICAL), $message);
88
                        $message = str_replace('{{SYSTEM_URL}}', OIDplus::webpath(null,OIDplus::PATH_ABSOLUTE_CANONICAL), $message);
89
                        $message = str_replace('{{SYSTEM_TITLE}}', OIDplus::config()->getValue('system_title'), $message);
89
                        $message = str_replace('{{SYSTEM_TITLE}}', OIDplus::config()->getValue('system_title'), $message);
90
                        $message = str_replace('{{ADMIN_EMAIL}}', OIDplus::config()->getValue('admin_email'), $message);
90
                        $message = str_replace('{{ADMIN_EMAIL}}', OIDplus::config()->getValue('admin_email'), $message);
Line 101... Line 101...
101
 
101
 
102
                        $email = $params['email'];
102
                        $email = $params['email'];
103
                        $auth = $params['auth'];
103
                        $auth = $params['auth'];
104
                        $timestamp = $params['timestamp'];
104
                        $timestamp = $params['timestamp'];
105
 
105
 
106
                        if (!OIDplus::authUtils()->validateAuthKey('com.viathinksoft.freeoid.activate_freeoid;'.$email.';'.$timestamp, $auth)) {
106
                        if (!OIDplus::authUtils()->validateAuthKey('40c87e20-f4fb-11ed-86ca-3c4a92df8582:'.$email.'/'.$timestamp, $auth)) {
107
                                throw new OIDplusException(_L('Invalid auth key'));
107
                                throw new OIDplusException(_L('Invalid auth key'));
108
                        }
108
                        }
109
 
109
 
110
                        if ((OIDplus::config()->getValue('max_ra_invite_time') > 0) && (time()-$timestamp > OIDplus::config()->getValue('max_ra_invite_time'))) {
110
                        if ((OIDplus::config()->getValue('max_ra_invite_time') > 0) && (time()-$timestamp > OIDplus::config()->getValue('max_ra_invite_time'))) {
111
                                throw new OIDplusException(_L('Invitation expired!'));
111
                                throw new OIDplusException(_L('Invitation expired!'));