Skip to content
This repository was archived by the owner on May 19, 2025. It is now read-only.

Commit 05d806f

Browse files
committed
hide plugin menu from unpriviledged users #12
1 parent 4f72734 commit 05d806f

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

authMgrPlus/plugin.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Plugin Name: Auth Manager Plus
44
Plugin URI: https://github.com/joshp23/YOURLS-AuthMgrPlus
55
Description: Role Based Access Controlls with seperated user data for authenticated users
6-
Version: 2.0.0
6+
Version: 2.1.0
77
Author: Josh Panter, nicwaller, Ian Barber <[email protected]>
88
Author URI: https://unfettered.net
99
*/
@@ -166,10 +166,18 @@ function amp_admin_sublinks( $links ) {
166166
unset($links['plugins'][$link]);
167167
}
168168
}
169+
170+
if( empty( $links['plugins'] ) )
171+
yourls_add_filter( 'admin_links', 'amp_admin_links' );
172+
169173
sort($links['plugins']);
170174
return $links;
171175
}
172176

177+
function amp_admin_links( $links ) {
178+
unset($links['plugins']);
179+
return $links;
180+
}
173181
/*
174182
* Cosmetic filter: displays currently available roles
175183
* by hovering mouse over the username in logout link.

0 commit comments

Comments
 (0)