Revise user-password.php - Admin folder rename

Add variable in bl-kernel/boot/init.php that allows User to rename bl-kernel/admin folder. 
User can then define variable in bl-kernel/boot/init.php and change the foldername itself to effect the rename. 

Add global $adminfolder as necessary and replace relevant 'admin' strings with $adminfolder.
Applies to most of the files in bl-kernel/admin/controllers.

Line 40 - Reference Admin folder variable 
               global $adminfolder;

Line 55 - Replace Admin string with folder variable:
		Redirect::page($adminfolder, 'users');
Original:   	Redirect::page('admin', 'users');

Line 71 - Replace Admin string with folder variable:
	        Redirect::page($adminfolder, 'users');
Original:   	Redirect::page('admin', 'users')
This commit is contained in:
Kim Keown 2016-10-25 07:02:03 -06:00 committed by GitHub
parent bd5440c0d7
commit 6931a53030

View File

@ -36,11 +36,12 @@ function setPassword($username, $new_password, $confirm_password)
// ============================================================================ // ============================================================================
// Main before POST // Main before POST
// ============================================================================ // ============================================================================
global $adminfolder;
// ============================================================================ // ============================================================================
// POST Method // POST Method
// ============================================================================ // ============================================================================
if( $_SERVER['REQUEST_METHOD'] == 'POST' ) if( $_SERVER['REQUEST_METHOD'] == 'POST' )
{ {
// Prevent editors to administrate other users. // Prevent editors to administrate other users.
@ -51,7 +52,7 @@ if( $_SERVER['REQUEST_METHOD'] == 'POST' )
} }
if( setPassword($_POST['username'], $_POST['new_password'], $_POST['confirm_password']) ) { if( setPassword($_POST['username'], $_POST['new_password'], $_POST['confirm_password']) ) {
Redirect::page('admin', 'users'); Redirect::page($adminfolder, 'users');
} }
} }
@ -67,7 +68,7 @@ $_user = $dbUsers->getDb($layout['parameters']);
// If the user doesn't exist, redirect to the users list. // If the user doesn't exist, redirect to the users list.
if($_user===false) { if($_user===false) {
Redirect::page('admin', 'users'); Redirect::page($adminfolder, 'users');
} }
$_user['username'] = $layout['parameters']; $_user['username'] = $layout['parameters'];