Jump to content
tim_ver

Easy Admin Group - Login Issues

Recommended Posts

8 minutes ago, hungryfrank said:

spoke too soon.it works better. now I get multiple checkboxes but they are all configuration

It is progress though.

Share this post


Link to post
Share on other sites
15 minutes ago, hungryfrank said:

it seems to work. I haven't tested functionality but seems to work. 

just include column_left.php directly.

 

if you guys want to test it

Yeah that works, but @burt must have changed it to a hook call for a reason, so how do we get it working with the hook?

Share this post


Link to post
Share on other sites
1 hour ago, Fredi said:

I do not understand why column_left is called. Column_left works differently. This is probably an outdated way. A lot has changed in the Phoenix core, so this function probably needs to be adjusted.

I don’t know how to do this. This has something to do with calling categories / files for visualization.
Maybe you need an analogy with a call to security_checks.php or similar?

the code is not changed a lot. it is just moved around. and filename and table defenitions are gone. for good or bad I don't judge 


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
6 minutes ago, LeeFoster said:

Yeah that works, but @burt must have changed it to a hook call for a reason, so how do we get it working with the hook?

he is probably trying to moduleize it at some point.

if you want to keep it like that you might be able to just include some parts of it. and then use the hook also. 

as it is the output of the hook is the only thing that it is returned. but here we need the value of array

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
27 minutes ago, hungryfrank said:

he is probably trying to moduleize it at some point.

if you want to keep it like that you might be able to just include some parts of it. and then use the hook also. 

I'd rather not make changes to the core code as they'll need to be done every time a release overwrites one of those files.

Share this post


Link to post
Share on other sites
3 hours ago, LeeFoster said:

I'd rather not make changes to the core code as they'll need to be done every time a release overwrites one of those files.

you can do that    - PayPal app 

<?php
/*
  $Id$

  osCommerce, Open Source E-Commerce Solutions
  http://www.oscommerce.com

  Copyright (c) 2014 osCommerce

  Released under the GNU General Public License
*/

  if (tep_session_is_registered('admin')) {
    $cl_box_groups = array();
 $cl_box_groups = array();
    if ($dir = @dir(DIR_FS_ADMIN . 'includes/boxes')) {
      $files = array();

      while ($file = $dir->read()) {
        if (!is_dir($dir->path . '/' . $file)) {
          if (substr($file, strrpos($file, '.')) == '.php') {
            $files[] = $file;
          }
        }
      }

      $dir->close();

      natcasesort($files);

      foreach ( $files as $file ) {
        if ( file_exists(DIR_FS_ADMIN . 'includes/languages/' . $language . '/modules/boxes/' . $file) ) {
          include(DIR_FS_ADMIN . 'includes/languages/' . $language . '/modules/boxes/' . $file);
        }

        include($dir->path . '/' . $file);
      }
    }

  
    usort($cl_box_groups, 'tep_sort_admin_boxes');

   

    foreach ( $cl_box_groups as &$group ) {
      usort($group['apps'], 'tep_sort_admin_boxes_links');
    }
    }
?>

and include this file in the top of the administrator_group.php

this will give you an error  about PayPal.

you have to take the paypal box out or another code change in PayPal.php which is very easy and harmless

  include(DIR_FS_CATALOG . 'includes/apps/paypal/admin/functions/boxes.php');

to

  include_once(DIR_FS_CATALOG . 'includes/apps/paypal/admin/functions/boxes.php');

then it works

 

 


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

 inn code above change 

     $files[] = $file;

to

    if (strpos($file, 'paypal') === false)    $files[] = $file;

this will give u everything except PayPal in admin groups control

but no core change

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
1 hour ago, hungryfrank said:

 inn code above change 


     $files[] = $file;

to


    if (strpos($file, 'paypal') === false)    $files[] = $file;

this will give u everything except PayPal in admin groups control

but no core change

I'll test this tomorrow. Thanks

Share this post


Link to post
Share on other sites

by all means go-ahead and make the add-on. 

you can ask Burt to make. a change to the core which dose not effect anything.

 include(DIR_FS_CATALOG . 'includes/apps/paypal/admin/functions/boxes.php');

to

  include_once(DIR_FS_CATALOG . 'includes/apps/paypal/admin/functions/boxes.php');

in PayPal.php and everything would work flawlessly. or he might have a better idea.

 


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

Good morning everybody!

Did you manage to solve this or did it stop?


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. one way with simple code change, and one that works with all boxes except the PayPal without

14 minutes ago, Fredi said:

Good morning everybody!

Did you manage to solve this or did it stop?

 


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
On 2/9/2020 at 3:09 PM, hungryfrank said:

include(DIR_FS_CATALOG . 'includes/apps/paypal/admin/functions/boxes.php');

to

  include_once(DIR_FS_CATALOG . 'includes/apps/paypal/admin/functions/boxes.php');

Thise Code?


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
On 2/8/2020 at 10:42 PM, hungryfrank said:

you can do that    - PayPal app 


<?php
/*
  $Id$

  osCommerce, Open Source E-Commerce Solutions
  http://www.oscommerce.com

  Copyright (c) 2014 osCommerce

  Released under the GNU General Public License
*/

  if (tep_session_is_registered('admin')) {
    $cl_box_groups = array();
 $cl_box_groups = array();
    if ($dir = @dir(DIR_FS_ADMIN . 'includes/boxes')) {
      $files = array();

      while ($file = $dir->read()) {
        if (!is_dir($dir->path . '/' . $file)) {
          if (substr($file, strrpos($file, '.')) == '.php') {
            $files[] = $file;
          }
        }
      }

      $dir->close();

      natcasesort($files);

      foreach ( $files as $file ) {
        if ( file_exists(DIR_FS_ADMIN . 'includes/languages/' . $language . '/modules/boxes/' . $file) ) {
          include(DIR_FS_ADMIN . 'includes/languages/' . $language . '/modules/boxes/' . $file);
        }

        include($dir->path . '/' . $file);
      }
    }

  
    usort($cl_box_groups, 'tep_sort_admin_boxes');

   

    foreach ( $cl_box_groups as &$group ) {
      usort($group['apps'], 'tep_sort_admin_boxes_links');
    }
    }
?>

and include this file in the top of the administrator_group.php

this will give you an error  about PayPal.

you have to take the paypal box out or another code change in PayPal.php which is very easy and harmless

  include(DIR_FS_CATALOG . 'includes/apps/paypal/admin/functions/boxes.php');

to

  include_once(DIR_FS_CATALOG . 'includes/apps/paypal/admin/functions/boxes.php');

then it works

 

 

this is what you have to do and considering that you have to make core changes any way is the best option.


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

In version 1.0.6.0 this does not work.


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
 function display_block_to_admin_group($administrator_group_block){
	  global $admin;
	  $display_block_to_admin_group = false;
	  $administrator_group_id = (int)$admin['user_group_id'];

	  if($administrator_group_id <= 0){
		  $display_block_to_admin_group = true;
	  }

	  if($administrator_group_block != '' && $administrator_group_id > 0){
		  $check_file_access = tep_db_query("select ag.administrator_group_id from " . TABLE_ADMINISTRATOR_GROUPS . " ag, " . TABLE_ADMINISTRATOR_GROUP_ACCESS . " aga where aga.administrator_group_id = ag.administrator_group_id and ag.administrator_group_id = '" . (int)$administrator_group_id . "' and aga.administrator_group_block = '" . $administrator_group_block . "'");
		  if(tep_db_num_rows($check_file_access))$display_block_to_admin_group = true;
	  }

	  return $display_block_to_admin_group;
  }

this is not working. 


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 have tried to investigate.

i have  an older style box insalled and that one works.  

 for the old box I have 

the value of    administrator_group_block   set as    <i class="fa fa-gavel" aria-hidden="true"></i> Ebay

and for the new boxes i have    <i title="Catalog" data-toggle="tooltip" data-placement="right" class="fas fa-cart-plus fa-fw mr-1">

and in the  hMenue.php  I have 

 foreach ( $cl_box_groups as &$group ) {
        usort($group['apps'], 'tep_sort_h_boxes_links');
      }
  
      $n = 1; $mr = null;
      foreach ($cl_box_groups as $groups) {
      
        $mr .= '<li class="nav-item dropdown">';
    if(display_block_to_admin_group($groups['heading'])) 
       $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++;
      }

I guess I need to change the sql below, but can't figure it out

  $check_file_access = tep_db_query("select ag.administrator_group_id from " . TABLE_ADMINISTRATOR_GROUPS . " ag, " . TABLE_ADMINISTRATOR_GROUP_ACCESS . " aga where aga.administrator_group_id = ag.administrator_group_id and ag.administrator_group_id = '" . (int)$administrator_group_id . "' and aga.administrator_group_block = '" . $administrator_group_block . "'");
		  if(tep_db_num_rows($check_file_access))$display_block_to_admin_group = true;
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

ok I got it working.

I had to change the database because the title its now more than 100 character.

I don't think it can be done without core changes. I am thinking about it.

unfortunately the nav bar is a hook and can not be turned off so it must be edited. 

 

 

 


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

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

×