Error: Permission denied message – login form instead?
Author | Posts |
---|---|
April 26, 2013 at 1:30 am 2883 | |
Tareq Hasan | Firstly - great plugin, really, really like where this is going. Quick question, if my client visits the page I have set up for them to view their project - if they are not already logged in, instead of simply getting a "Error: Permission denied" message displayed on the page, is it possible to display a login form? This kind of thing; But only if they are not already logged in. Know what I mean? Having this kind of functionality as part of the front-end for this plugin would be a great addition... :) Thanks, Jas |
April 26, 2013 at 2:49 am 2885 | |
jhkoning | I’m no php programmer, but it’d be in header.php I’d imagine, somewhere around here; `if ( !$pro_obj->has_permission( $project ) ) { ‘ . __( ‘Error: Permission denied’, ‘cpm’ ) . ‘‘; Where it may(?) be possible to add in a login form if the user isn’t already logged in? |
April 26, 2013 at 4:56 am 2891 | |
Tareq Hasan | I assume the problem you want to deal with the frontend version? |
April 27, 2013 at 12:02 am 2921 | |
jhkoning | Hi Tareq, |
April 27, 2013 at 7:29 am 2930 | |
Tareq Hasan | So may be you need to alter some code in the frontend plugins `frontend.php`. Replace the `shortcode` function with this: [php] if ( !$this->is_plugin_installed() ) { if ( $id ) { if ( !is_user_logged_in() ) { ob_start(); <div class="cpm"> return ob_get_clean(); It’ll show login form if the user is not logged in. |