Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactoring: web guest vs admin separation #60

Merged
merged 16 commits into from Oct 11, 2012

Conversation

obilodeau
Copy link
Contributor

$portalSession's stuff is only relevant on the captive portal facing scenario. This refactoring splits out client facing and admin facing code so mistakes are harder to make. It also provides render_template(), it's own template directory, regrouped i18n and a stash-like template variables approach just like on the portalSession side.

A commit per commit review is probably the easiest way to review since there's a lot of code movement in there.

Fixes #1485: pf::web::guest / admin guest creation need some kind of separation

Ready for integration and code review.

Aimed at devel branch.

Moved pf::web::generate_admin_error_page to pf::web::admin::generate_error_page.
Reduced code duplication. Introduced admin templates path. More to come!
- tests were migrated also
- special variable for P::S object to avoid initialization (simplifies testing)

Another change in the vein of pf::web vs pf::web::admin split. ~#1485
Additionally
* generate_registration_page no longer requires a redundant $post_uri parameter that was pushed as a URL constant instead
* introduced _init_i18n that regroups the i18n stuff done in every generate... method (will be used as we migrate subs)
* pf::web::admin's render_template insert pf::web::constants for template consumption
* valid_access_duration
* valid_arrival_date
* validate_registration -> validate_guest_creation
* validate_registration_multiple -> validate_guest_creation_multiple
* validate_registration_import -> validate_guest_import
* preregister -> create_guest
* preregister_multiple -> create_guest_multiple
* generate_registration_confirmation_page -> generate_guestcreation_confirmation_page
* import_csv
Avoided API changes by splitting subs into admin specific subs at the
cost of code duplication.

http://packetfence.org/bugs/view.php?id=1518
(cherry picked from commit 5200af3)

Conflicts:

	lib/pf/web/guest.pm
* generate_admin_login_page -> generate_login_page
* manager_authenticate -> authenticate
@cgx
Copy link
Collaborator

cgx commented Sep 28, 2012

Looks fine. That's a very appreciated aggregation. Let's merge!

@dwlfrth
Copy link
Contributor

dwlfrth commented Oct 10, 2012

Lots of nice modifications.
That will enhance the web part a lot.
Seems ready to merge (integration!)

@fgaudreault fgaudreault merged commit 4d39591 into devel Oct 11, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants