File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 154154 );
155155 $ form ->addHeader ($ message );
156156 $ form ->addElement ('hidden ' , 'sec_token ' , Security::getTokenFromSession ());
157- $ form ->addElement ('hidden ' , 'subscribe_user_with_password ' , $ courseInfo ['code ' ]);
157+ $ form ->addElement ('hidden ' , 'subscribe_user_with_password ' , $ courseInfo ['id ' ]);
158158 $ form ->addElement ('text ' , 'course_registration_code ' );
159159 $ form ->addButtonSave (get_lang ('Submit registration code ' ));
160160 $ content = $ form ->returnForm ();
161161
162162 if ($ form ->validate ()) {
163163 if (sha1 ($ _POST ['course_registration_code ' ]) === $ courseInfo ['registration_code ' ]) {
164- $ subscribeCourseInfo = api_get_course_info ($ _POST ['subscribe_user_with_password ' ]);
165- CourseManager::autoSubscribeToCourse ($ subscribeCourseInfo ['id ' ]);
164+ CourseManager::autoSubscribeToCourse ((int )$ _POST ['subscribe_user_with_password ' ]);
166165
167166 if ('course_home ' === $ redirectAfterSubscription ) {
168167 $ redirectionTarget = $ courseInfo ['course_public_url ' ];
You can’t perform that action at this time.
0 commit comments