Ticket #4478 (new enhancement)

Opened 1 year ago

Last modified 2 months ago

Allow login form to be completely taken over

Reported by: Viper007Bond Assigned to: anonymous
Priority: low Milestone: 2.7
Component: Administration Version: 2.5.1
Severity: minor Keywords: login, registration, needs-patch
Cc:

Description

Right before any HTML is outputted, I think it'd be great to stick hooks. This way, if you wanted, you could output your own entire HTML and then die(); rather than just skinning the existing login form.

Brought about by seeing Playstation US's blog and realizing that they either had to edit the output buffer or the actual wp-login.php to accomplish their severe customization.

Flexibility for the win! :)

Attachments

wp-login.php.diff (4.1 kB) - added by stealthdave on 05/01/08 20:39:39.
Patch to allow custom login / registration templates from template. Updated patch works with 2.5.1.
sample.login.php (480 bytes) - added by stealthdave on 05/01/08 20:42:09.
Sample login.php file to demonstrate custom templated login pages. Updated sample works with 2.5.1.

Change History

06/16/07 17:55:19 changed by rob1n

  • milestone changed from 2.3 (trunk) to 2.4 (future).

(follow-up: ↓ 3 ) 06/17/07 00:25:43 changed by markjaquith

How about hooking on init, with a PHP_SELF comparison as the activating criterion?

(in reply to: ↑ 2 ) 06/18/07 01:03:29 changed by Viper007Bond

Replying to markjaquith:

How about hooking on init, with a PHP_SELF comparison as the activating criterion?

That'd currently work, but then you would have to replicate all of the PHP that goes on in wp-login.php and keep it up to date as WP progresses with new versions.

I'm just talking about being able to have entirely custom HTML.

09/30/07 01:47:02 changed by richcon

Why not make the login and registration screens completely template-based? So there would be a login.php in the default theme that other themes can override, or add 'login' and/or 'registration' forms to any page they want. This seems to me like the ultimate solution for bringing those pages in line with the rest of a site's design.

(follow-up: ↓ 10 ) 09/30/07 02:39:15 changed by Otto42

I don't see why Playstation's blog would have needed more than a custom plugin to do what they did. wp-login.php is littered with hooks, and their customizations appear to be using those hooks, near as I can tell.

Reference Ticket #3123

(follow-up: ↓ 7 ) 09/30/07 05:36:30 changed by JeremyVisser

I disagree that wp-login.php should be based on the frontend theme. It is part of the backend.

(in reply to: ↑ 6 ) 10/01/07 00:35:41 changed by foolswisdom

Replying to JeremyVisser:

I disagree that wp-login.php should be based on the frontend theme. It is part of the backend.

One person's backend is another person's frontend ;)

10/21/07 04:36:52 changed by cpoteet

+1 for Richon's suggestion.

10/21/07 04:55:10 changed by DD32

Possibly another method that could be used is a action before most of the wp-login.php code is run.

A plugin could hook the action and then die to prevent the main login page running. That can be done in the admin section already by hooking the load-page.php action, So maybe doing the same for the login form should be possible if its 'backend' and as such, not template styled.

(in reply to: ↑ 5 ) 10/21/07 05:02:07 changed by Viper007Bond

Replying to Otto42:

I don't see why Playstation's blog would have needed more than a custom plugin to do what they did. wp-login.php is littered with hooks, and their customizations appear to be using those hooks, near as I can tell. Reference Ticket #3123

Yes, the "date of birth" is easy as cake due to #3123 but the sidebar, header, etc. aren't unless I'm missing something obvious.

12/17/07 23:13:40 changed by oaoao

+2 for Richon's suggestion.

02/11/08 04:37:29 changed by stealthdave

  • keywords set to login, registration.
  • milestone changed from 2.5 to 2.3.4.

The attached patch allows template designers to create a custom login_header() and/or login_footer() function in $templatedir/login.php. Attached sample login.php template shows implementation with standard template header, footer and sidebar.

02/11/08 16:35:25 changed by lloydbudd

  • keywords changed from login, registration to login, registration, has-patch.
  • milestone changed from 2.3.4 to 2.5.

03/19/08 03:42:41 changed by ffemtcj

  • milestone changed from 2.5 to 2.6.

05/01/08 20:39:39 changed by stealthdave

  • attachment wp-login.php.diff added.

Patch to allow custom login / registration templates from template. Updated patch works with 2.5.1.

05/01/08 20:42:09 changed by stealthdave

  • attachment sample.login.php added.

Sample login.php file to demonstrate custom templated login pages. Updated sample works with 2.5.1.

05/01/08 20:45:45 changed by stealthdave

  • version changed from 2.3 to 2.5.1.

Updated patch now works with 2.5.1. Also abstracts out the error messaging code from the login_header into its own function, allowing it to be reused in the custom login template.

05/01/08 23:28:00 changed by mrgreen

Thanks for starting this, it's an important improvement!

05/05/08 20:36:57 changed by westi

  • keywords changed from login, registration, has-patch to login, registration, needs-patch.
  • milestone changed from 2.6 to 2.7.

The current patch doesn't cut it for me.

What would be better would be to move as much as possible of the code in wp-login.php into a file in wp-includes and then use the normal wp-includes/template-loader.php code to load a login template if one exists and otherwise fallback to the current code - albeit in the more function based approach.

Pushing out to 2.7 for now until we have a bigger patch ;-)