Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Easy Admin Group - Login Issues


tim_ver

Recommended Posts

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

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

Link to comment
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?

Link to comment
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

Link to comment
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

Link to comment
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.

Link to comment
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

Link to comment
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

Link to comment
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

Link to comment
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

Link to comment
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

Link to comment
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

Link to comment
Share on other sites

  • 2 months later...
On 5/7/2020 at 9:06 PM, Fredi said:

In version 1.0.6.0 this does not work.

what dosen't  work?  what have u done?

I am working on the same thing, maybe we can figure it out

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

Link to comment
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

Link to comment
Share on other sites

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

Link to comment
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

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...