From: Laury GvR Date: Fri, 12 May 2017 16:09:36 +0000 (-0400) Subject: Fixed the Plugin Slug define as used by the update server X-Git-Tag: v1.6.1^2 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=11be1c89165f62e67edcd3f56c28038d7ab89bda;p=WP-Plugins%2FGaslightify.git Fixed the Plugin Slug define as used by the update server --- diff --git a/Gaslightify.php b/Gaslightify.php deleted file mode 100755 index 4025f1e..0000000 --- a/Gaslightify.php +++ /dev/null @@ -1,231 +0,0 @@ -declareCredentials(array( - 'license_key' => __('License Key:') - )); - -add_action('admin_enqueue_scripts', 'interface_client_safeguard'); - -function interface_client_safeguard() { - if ( current_user_can( 'manage_options' ) ) { - /* A user with admin privileges */ - wp_enqueue_style('GaslightifyAdminStyle', plugins_url('css/GaslightifyAdmin.css', __FILE__)); - - } else { - /* A user without admin privileges */ - wp_enqueue_script('GaslightifyJs', plugins_url('js/Gaslightify.js', __FILE__),array(),'1.0.0', true); - wp_enqueue_style('GaslightifyClientsStyle', plugins_url('css/GaslightifyClients.css', __FILE__)); - if ( is_multisite() ) { - wp_enqueue_style('GaslightifyMultiSiteStyle', plugins_url('css/GaslightifyMultiSite.css', __FILE__)); - } - } - if ( !current_user_can( 'edit_posts' ) ) { - ?> - - - - - - - - This Theme was created by Gaslight Media.

'; - echo ""; -} - -add_action('admin_footer_text', 'my_admin_footer'); - -function left_admin_footer_text_output($text) { -// $text = '

This Theme was made by Gaslight Media.

'; - return $text; -} - -add_filter('update_footer', 'right_admin_footer_text_output', 11, true); //right side -function right_admin_footer_text_output($text) { - $text = ''; - return $text; -} - -add_filter('login_errors','login_error_message'); - -function login_error_message($error){ - //check if that's the error you are looking for - $pos = strpos($error, 'incorrect'); - if (is_int($pos)) { - //its the right error so you can overwrite it - $error = "Invalid Credentials. Please ensure the username and password you entered are correct."; - } - return $error; -} - -add_action('admin_bar_menu', 'glm_custom_logo'); - -function glm_custom_logo() { - ?> - - - -get_node('my-account'); - $newtitle = str_replace( 'Howdy,', 'Welcome back,', $my_account->title . "!" ); - $wp_admin_bar->add_node( array( - 'id' => 'my-account', - 'title' => $newtitle, - ) ); -} -add_filter( 'admin_bar_menu', 'replace_howdy',25 ); -function glm_stats(){ - echo '
- - -
-'; -} -function Gaslightify_menu() { - if ( current_user_can( 'edit_others_pages' ) ) { - add_menu_page('Server Stats', 'Server Stats', 'edit_posts', 'glm_stats', 'glm_stats', 'dashicons-chart-area'); - if (class_exists('Ninja_Forms')) { - add_menu_page('Form Submissions', 'Form Submissions', 'edit_posts', 'edit.php?post_type=nf_sub', '', 'dashicons-feedback'); - } - } -} -add_action('admin_menu', 'Gaslightify_menu'); -/* To give Editors access to the Submissions - Simply replace ‘edit_posts’ in the code snippet below with the capability -that you would like to attach the ability to view/edit submissions to.Please note that all three filters are needed to -provide proper submission viewing/editing on the backend! -*/ -function nf_subs_capabilities( $cap ) { - return 'edit_posts'; -} -add_filter( 'ninja_forms_admin_submissions_capabilities', 'nf_subs_capabilities' ); -add_filter( 'ninja_forms_admin_parent_menu_capabilities', 'nf_subs_capabilities' ); -//add_filter( 'ninja_forms_admin_menu_capabilities', 'nf_subs_capabilities' ); -add_filter('json_enabled', '__return_false'); -add_filter('json_jsonp_enabled', '__return_false'); -?> diff --git a/defines.php b/defines.php index b05512a..485f667 100755 --- a/defines.php +++ b/defines.php @@ -11,5 +11,7 @@ define('GLM_GASLIGHTIFY_PLUGIN_UPDATE_SERVER', 'http://www.gaslightmedia.com/update_server'); define('GLM_GASLIGHTIFY_PLUGIN_PATH', dirname(__FILE__)); + define('GLM_GASLIGHTIFY_PLUGIN_SLUG', 'Gaslightify'); + define('GLM_GASLIGHTIFY_PLUGIN_LIB_PATH', GLM_GASLIGHTIFY_PLUGIN_PATH.'/lib'); //define('GLM_GASLIGHTIFY_PLUGIN_LIB_PATH', ''); \ No newline at end of file diff --git a/index.php b/index.php new file mode 100755 index 0000000..9a5f061 --- /dev/null +++ b/index.php @@ -0,0 +1,231 @@ +declareCredentials(array( + 'license_key' => __('License Key:') + )); + +add_action('admin_enqueue_scripts', 'interface_client_safeguard'); + +function interface_client_safeguard() { + if ( current_user_can( 'manage_options' ) ) { + /* A user with admin privileges */ + wp_enqueue_style('GaslightifyAdminStyle', plugins_url('css/GaslightifyAdmin.css', __FILE__)); + + } else { + /* A user without admin privileges */ + wp_enqueue_script('GaslightifyJs', plugins_url('js/Gaslightify.js', __FILE__),array(),'1.0.0', true); + wp_enqueue_style('GaslightifyClientsStyle', plugins_url('css/GaslightifyClients.css', __FILE__)); + if ( is_multisite() ) { + wp_enqueue_style('GaslightifyMultiSiteStyle', plugins_url('css/GaslightifyMultiSite.css', __FILE__)); + } + } + if ( !current_user_can( 'edit_posts' ) ) { + ?> + + + + + + + + This Theme was created by Gaslight Media.

'; + echo ""; +} + +add_action('admin_footer_text', 'my_admin_footer'); + +function left_admin_footer_text_output($text) { +// $text = '

This Theme was made by Gaslight Media.

'; + return $text; +} + +add_filter('update_footer', 'right_admin_footer_text_output', 11, true); //right side +function right_admin_footer_text_output($text) { + $text = ''; + return $text; +} + +add_filter('login_errors','login_error_message'); + +function login_error_message($error){ + //check if that's the error you are looking for + $pos = strpos($error, 'incorrect'); + if (is_int($pos)) { + //its the right error so you can overwrite it + $error = "Invalid Credentials. Please ensure the username and password you entered are correct."; + } + return $error; +} + +add_action('admin_bar_menu', 'glm_custom_logo'); + +function glm_custom_logo() { + ?> + + + +get_node('my-account'); + $newtitle = str_replace( 'Howdy,', 'Welcome back,', $my_account->title . "!" ); + $wp_admin_bar->add_node( array( + 'id' => 'my-account', + 'title' => $newtitle, + ) ); +} +add_filter( 'admin_bar_menu', 'replace_howdy',25 ); +function glm_stats(){ + echo '
+ + +
+'; +} +function Gaslightify_menu() { + if ( current_user_can( 'edit_others_pages' ) ) { + add_menu_page('Server Stats', 'Server Stats', 'edit_posts', 'glm_stats', 'glm_stats', 'dashicons-chart-area'); + if (class_exists('Ninja_Forms')) { + add_menu_page('Form Submissions', 'Form Submissions', 'edit_posts', 'edit.php?post_type=nf_sub', '', 'dashicons-feedback'); + } + } +} +add_action('admin_menu', 'Gaslightify_menu'); +/* To give Editors access to the Submissions - Simply replace ‘edit_posts’ in the code snippet below with the capability +that you would like to attach the ability to view/edit submissions to.Please note that all three filters are needed to +provide proper submission viewing/editing on the backend! +*/ +function nf_subs_capabilities( $cap ) { + return 'edit_posts'; +} +add_filter( 'ninja_forms_admin_submissions_capabilities', 'nf_subs_capabilities' ); +add_filter( 'ninja_forms_admin_parent_menu_capabilities', 'nf_subs_capabilities' ); +//add_filter( 'ninja_forms_admin_menu_capabilities', 'nf_subs_capabilities' ); +add_filter('json_enabled', '__return_false'); +add_filter('json_jsonp_enabled', '__return_false'); +?>