picocms / Pico

Pico is a stupidly simple, blazing fast, flat file CMS.
http://picocms.org/
MIT License
3.85k stars 615 forks source link

[Plugin] Changing Pico Edit URL #364

Closed ghost closed 8 years ago

ghost commented 8 years ago

Forgive me if I write something wrong. I'm not fluent in English.

I want to access the admin area by using pico.dev/admin instead of the default pico.dev/pico_edit. I'm able to log in and out without getting any errors when I edit the lines 23, 131 and 133 of pico_edit.php, but I cannot see or create any content. The pages appear to be blank.

Image

Here is what I did:

Line 23 before and after: $twig_vars['pico_edit_url'] = $this->getPageUrl( 'pico_edit' ); $twig_vars['pico_edit_url'] = $this->getPageUrl( 'admin' );

Line 131 before and after: if( $url == 'pico_edit' ) $this->is_admin = true; if( $url == 'admin' ) $this->is_admin = true;

Line 133 before and after: if( $url == 'pico_edit/logout' ) $this->is_logout = true; if( $url == 'admin/logout' ) $this->is_logout = true;

When I edit the other lines (132 to 135 and 137 to 139) I get {"error":"Error: Unathorized"}.

What do I have to do to make the admin area work properly? Can someone help me?

PhrozenByte commented 8 years ago

@blocknotes's pico_edit plugin unfortunately doesn't support changing the admin URL. However, we're working on a official admin plugin for Pico 1.1 what will support this, so please stay tuned.

ghost commented 8 years ago

@PhrozenByte Thank you for the quick response and for letting me know. :blush:

blocknotes commented 8 years ago

@marcellecrist: to change the path you need also to rename the plugin folder to 'admin' and every path reference to 'admin/' (you could do a search of pico_edit inside the plugin folder). If I were you I would choose something less predictable, just for a bit more security