Jump to content
tim_ver

Easy Admin Group - Login Issues

Recommended Posts

On 5/7/2020 at 9:06 PM, Fredi said:

In version 1.0.6.0 this does not work.

to make it work

make all the changes as before.

in includes/hooks/admin/siteWide/hMenu

change

 foreach ($cl_box_groups as $groups) {

        $mr .= '<li class="nav-item dropdown">';
        $mr .= '<a class="nav-link dropdown-toggle" href="#" id="navbar_' . $n . '" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">' . $groups['heading'] . '</a>';
        $al = ($n > 6) ? ' dropdown-menu-right' : '';
        $mr .= '<div class="dropdown-menu' . $al . '" aria-labelledby="navbar_' . $n . '">';
       foreach ($groups['apps'] as $app) {        
 
        $mr .= '<a class="dropdown-item" href="' . $app['link'] . '">' . $app['title'] . '</a>';
          }
          $mr .= '</div>';
        $mr .= '</li>' . PHP_EOL;
        
        $n++;
      }

to 

 foreach ($cl_box_groups as $groups) {
 if(display_block_to_admin_group($groups['heading'])) {
        $mr .= '<li class="nav-item dropdown">';
        $mr .= '<a class="nav-link dropdown-toggle" href="#" id="navbar_' . $n . '" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">' . $groups['heading'] . '</a>';
        $al = ($n > 6) ? ' dropdown-menu-right' : '';
        $mr .= '<div class="dropdown-menu' . $al . '" aria-labelledby="navbar_' . $n . '">';
       foreach ($groups['apps'] as $app) {        
  if(check_admin_group($app['code'])) 
        $mr .= '<a class="dropdown-item" href="' . $app['link'] . '">' . $app['title'] . '</a>';
          }
          $mr .= '</div>';
        $mr .= '</li>' . PHP_EOL;
        
        $n++;
      }
 }

column_left.php iris not used


you can cut up to 4 pages of your checkout by using my three add_ons

login create account in one page

Express checkout  

login pop up modal

Share this post


Link to post
Share on other sites

 I need some help.

there are two modification to the core files that I was wondering if it is possible to do this with a hook or something

----------------------------------
admin/login.php
----------------------------------

FIND - 

          $check_query = tep_db_query("select id, user_name, user_password from " . TABLE_ADMINISTRATORS . " where user_name = '" . tep_db_input($username) . "'");

REPLACE - 

          $check_query = tep_db_query("select id, user_name, user_password, user_group_id from " . TABLE_ADMINISTRATORS . " where user_name = '" . tep_db_input($username) . "'");

---

FIND - 

              $admin = array('id' => $check['id'],
                             'username' => $check['user_name']);

REPLACE - 

              $admin = array('id' => $check['id'],
                             'username' => $check['user_name'],
							 'user_group_id' => $check['user_group_id']
							);
----------------------------------
admin/includes/application_top.php
----------------------------------

Please add the code before ?>

	if(!check_admin_group($current_page)){
		tep_redirect(tep_href_link('index.php'));
	}

 


you can cut up to 4 pages of your checkout by using my three add_ons

login create account in one page

Express checkout  

login pop up modal

Share this post


Link to post
Share on other sites
Posted (edited)

I can not install this module in the latest version. I am confused about the adjustments.
Last error:

Fatal error: Uncaught Error: Call to undefined function check_admin_group() in /home/xxx/public_html/admin/includes/application_top.php:179 Stack trace: #0 /home/xxx/public_html/admin/modules_hooks.php(13): require() #1 {main} thrown in /home/xxx/public_html/admin/includes/application_top.php on line 179

If all this works for you, can you assemble the module completely?

Edited by Fredi

Support forum for osCommerce in russian language - from Ashkelon. Support since 2002.

Best regards,

Fredi

Share this post


Link to post
Share on other sites
Posted (edited)

ok in a few days. maybe @ecartz  can help with fixing the login array and the redirect to be done with a hook or something. 

I have the code posted just above

Edited by hungryfrank

you can cut up to 4 pages of your checkout by using my three add_ons

login create account in one page

Express checkout  

login pop up modal

Share this post


Link to post
Share on other sites
Posted (edited)

Hi Frank,

Where can I download your full patched code?
You can add this addon to  https://apps.oscommerce.com/ ?

Regards,
Fred.

Edited by Fredi

Support forum for osCommerce in russian language - from Ashkelon. Support since 2002.

Best regards,

Fredi

Share this post


Link to post
Share on other sites

https://apps.oscommerce.com/xvqqc&amp;easy-admin-group-osc-2-3-xx.    

but I have made a new one that only has one file modificatiiion.  just to add a hook

I am testing it an will upload it in a couple of days


you can cut up to 4 pages of your checkout by using my three add_ons

login create account in one page

Express checkout  

login pop up modal

Share this post


Link to post
Share on other sites

Thank You Frank!!!

 


Support forum for osCommerce in russian language - from Ashkelon. Support since 2002.

Best regards,

Fredi

Share this post


Link to post
Share on other sites

Thank You, Frank.

I work with your module.
Your latest modification is slowly starting to work.

I got an error: Warning: Use of undefined constant MODULES_ADMIN_MENU_CONFIGURATION_ADMIN_GROUP - assumed 'MODULES_ADMIN_MENU_CONFIGURATION_ADMIN_GROUP' (this will throw an Error in a future version of PHP) in /home/domovik/public_html/Phmin/includes/boxes/configuration_admin_group.php on line 16

For correction, you need to add a constant to the language files:

define('MODULES_ADMIN_MENU_CONFIGURATION_ADMIN_GROUP', 'Configure Administrator Groups'); 

 


Support forum for osCommerce in russian language - from Ashkelon. Support since 2002.

Best regards,

Fredi

Share this post


Link to post
Share on other sites

change line 31 infile administrator_groups.php
          tep_db_perform('administrator_groups', $sql_data_aarray);

to

          tep_db_perform('administrator_groups', $sql_data_array);

Add to lanfuages files:

define('IMAGE_INSERT_NEW_ADMIN_GROUP', 'Add Admin Group');


Support forum for osCommerce in russian language - from Ashkelon. Support since 2002.

Best regards,

Fredi

Share this post


Link to post
Share on other sites

thanks Fredi. 

15 minutes ago, Fredi said:

change line 31 infile administrator_groups.php
          tep_db_perform('administrator_groups', $sql_data_aarray);

to

          tep_db_perform('administrator_groups', $sql_data_array);

Add to lanfuages files:

define('IMAGE_INSERT_NEW_ADMIN_GROUP', 'Add Admin Group');

https://apps.oscommerce.com/QpPPm&amp;easy-admin-group-for-phoenix1-0-6-0-easy.  

in this one??


you can cut up to 4 pages of your checkout by using my three add_ons

login create account in one page

Express checkout  

login pop up modal

Share this post


Link to post
Share on other sites

Yes, in this latest version.


Support forum for osCommerce in russian language - from Ashkelon. Support since 2002.

Best regards,

Fredi

Share this post


Link to post
Share on other sites

define('MODULES_ADMIN_MENU_CONFIGURATION_ADMIN_GROUP', 'Configure Administrator Groups'); 

Add to file english.php and other languages.


Support forum for osCommerce in russian language - from Ashkelon. Support since 2002.

Best regards,

Fredi

Share this post


Link to post
Share on other sites

yes this has its own add-on I did not add it to the old add-on so it can be found easier

in this one I make two new file one for administrator.php 

and one for hMenu.php. ad use these instead of file modifications.

there is no hook for adding a redirect now. so that is the only modification. I have to make a nice presentation to Burt for adding it.


you can cut up to 4 pages of your checkout by using my three add_ons

login create account in one page

Express checkout  

login pop up modal

Share this post


Link to post
Share on other sites
Posted (edited)
3 minutes ago, Fredi said:

define('MODULES_ADMIN_MENU_CONFIGURATION_ADMIN_GROUP', 'Configure Administrator Groups'); 

Add to file english.php and other languages.

ok I have to add a language file for this. I thought I did

Edited by hungryfrank

you can cut up to 4 pages of your checkout by using my three add_ons

login create account in one page

Express checkout  

login pop up modal

Share this post


Link to post
Share on other sites

If you need help with testing, I will do it.


Support forum for osCommerce in russian language - from Ashkelon. Support since 2002.

Best regards,

Fredi

Share this post


Link to post
Share on other sites

Notify me when there will be new files or adjustments.


Support forum for osCommerce in russian language - from Ashkelon. Support since 2002.

Best regards,

Fredi

Share this post


Link to post
Share on other sites
Posted (edited)

@Fredi

do you know where this folder is "override"

On 5/27/2020 at 9:08 PM, LeeFoster said:

Would you not call it hMenu.php and place it in the override folder?

and also I made a new file if u wanna to test it. this dose not need any core changes. haven't tested it one 1.0.7.x

 aMenu.php

Edited by hungryfrank

you can cut up to 4 pages of your checkout by using my three add_ons

login create account in one page

Express checkout  

login pop up modal

Share this post


Link to post
Share on other sites
Posted (edited)

if use PHP7.3 i have errors:

Notice: Undefined index: user_group_id in /home/xxxx/public_html/includes/hooks/admin/siteWide/aMenu.php on line 19

Notice: Undefined index: user_group_id in /home/xxxx/public_html/includes/hooks/admin/siteWide/aMenu.php on line 60

$administrator_group_id = (int)$admin['user_group_id'];

I cnanche thise to

 $administrator_group_id = isset($admin['administrator_group_id']) ? $administrator_group_id : '';

Work correct.

Edited by Fredi

Support forum for osCommerce in russian language - from Ashkelon. Support since 2002.

Best regards,

Fredi

Share this post


Link to post
Share on other sites

If I click the Add Admin button, I get a lot of warnings.

This is a conflict hMenu and aMenu:
Notice: Constant BOX_HEADING_ADMIN already defined in /home/xxxx/public_html/admin/includes/languages/english/modules/boxes/administrators.php on line 13

Notice: Constant MODULES_ADMIN_MENU_ADMINISTRATORS already defined in /home/xxxx/public_html/admin/includes/languages/english/modules/boxes/administrators_administrators.php on line 13

Notice: Constant MODULES_ADMIN_MENU_ADMINISTRATORS_GROUP already defined in /home/xxxx/public_html/admin/includes/languages/english/modules/boxes/administrators_groups.php on line 13

Notice: Constant BOX_HEADING_ARTICLE already defined in /home/xxxx/public_html/admin/includes/languages/english/modules/boxes/articles.php on line 13

Notice: Constant BOX_TOPICS_ARTICLES already defined in /home/xxxx/public_html/admin/includes/languages/english/modules/boxes/articles_articles.php on line 13

Notice: Constant ARTICLES_CONFIG already defined in /home/xxxx/public_html/admin/includes/languages/english/modules/boxes/articles_articles_config.php on line 13

Notice: Constant BOX_ARTICLES_XSELL already defined in /home/xxxx/public_html/admin/includes/languages/english/modules/boxes/articles_articles_xsell.php on line 13

Notice: Constant ARTICLE_REVIEVS already defined in /home/xxxx/public_html/admin/includes/languages/english/modules/boxes/articles_article_reviews.php on line 13

Notice: Constant BOX_ARTICLES_AUTORS already defined in /home/xxxx/public_html/admin/includes/languages/english/modules/boxes/articles_authors.php on line 13

Notice: Constant BOX_HEADING_CATALOG already defined in /home/xxxx/public_html/admin/includes/languages/english/modules/boxes/catalog.php on line 13

Notice: Constant MODULES_ADMIN_MENU_CATALOG_PRODUCTS already defined in /home/xxxx/public_html/admin/includes/languages/english/modules/boxes/catalog_categories.php on line 13

Notice: Constant MODULES_ADMIN_MENU_CATALOG_MANUFACTURERS already defined in/home/xxxx/public_html/admin/includes/languages/english/modules/boxes/catalog_manufacturers.php on line 13

Notice: Constant MODULES_ADMIN_MENU_CATALOG_PRODUCTS_ATTRIBUTES already defined in /home/xxxx/public_html/admin/includes/languages/english/modules/boxes/catalog_products_attributes.php on line 13

Notice: Constant MODULES_ADMIN_MENU_CATALOG_PRODUCTS_EXPECTED already defined in /home/xxxx/public_html/admin/includes/languages/english/modules/boxes/catalog_products_expected.php on line 13

Notice: Constant MODULES_ADMIN_MENU_CATALOG_REVIEWS already defined in /home/xxxx/public_html/admin/includes/languages/english/modules/boxes/catalog_reviews.php on line 13

............

How to resolve this conflict?


Support forum for osCommerce in russian language - from Ashkelon. Support since 2002.

Best regards,

Fredi

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×