Jump to content
tim_ver

Easy Admin Group - Login Issues

Recommended Posts

I have this installed and am getting the below error.

Quote

Warning: Invalid argument supplied for foreach() in admin\administrator_groups.php on line 156

 

Share this post


Link to post
Share on other sites

I am not maintaing this plugin with latest version of osc. I will have to check the code again. Can you put your osc version and photo version here?

Share this post


Link to post
Share on other sites

@LeeFoster

By chance, are you running PHP v7.x ?

M


If you are running the "official" osC 2.3.4 or 2.3.4.1 download, your installation is obsolete! Get the latest community-supported responsive "Frozen" release here

Share this post


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

I am not maintaing this plugin with latest version of osc. I will have to check the code again. Can you put your osc version and photo version here?

osc version is burts bs4 and php is 7.2.5

Share this post


Link to post
Share on other sites

@LeeFoster

That is a PHP Warning, not an Error. As I've said before, newer versions of PHP are becoming more strict. You could just ignore the warning, but it would be better to update the code to the current PHP structure. Do a search here in the forum for foreach(). It's been discussed before.

M


If you are running the "official" osC 2.3.4 or 2.3.4.1 download, your installation is obsolete! Get the latest community-supported responsive "Frozen" release here

Share this post


Link to post
Share on other sites
24 minutes ago, ArtcoInc said:

@LeeFoster

That is a PHP Warning, not an Error. As I've said before, newer versions of PHP are becoming more strict. You could just ignore the warning, but it would be better to update the code to the current PHP structure. Do a search here in the forum for foreach(). It's been discussed before.

M

No it's an error because it's also not showing the list of boxes that it should.

Share this post


Link to post
Share on other sites

 


If you are running the "official" osC 2.3.4 or 2.3.4.1 download, your installation is obsolete! Get the latest community-supported responsive "Frozen" release here

Share this post


Link to post
Share on other sites

@LeeFoster can you try to change
this line

foreach ($cl_box_groups as $groups) {

to

foreach ((array)$cl_box_groups as $groups) {

 

Share this post


Link to post
Share on other sites
9 minutes ago, Omar_one said:

@LeeFoster can you try to change
this line


foreach ($cl_box_groups as $groups) {

to


foreach ((array)$cl_box_groups as $groups) {

 

This got rid of the warning but I am still not seeing the list of boxes.

Share this post


Link to post
Share on other sites
22 minutes ago, LeeFoster said:

Yeah I'm not getting the list of boxes down the right.

did you  replaced  (admin/includes/column_left.php)

<?php
    foreach ($cl_box_groups as $groups) {
      echo '<h3><a href="#">' . $groups['heading'] . '</a></h3>' .
           '<div><ul>';

      foreach ($groups['apps'] as $app) {
        echo '<li><a href="' . $app['link'] . '">' . $app['title'] . '</a></li>';
      }

      echo '</ul></div>';
    }
?>

with this one

<?php
    foreach ($cl_box_groups as $groups) {
	 if(display_block_to_admin_group($groups['heading'])){
      echo '<h3><a href="#">' . $groups['heading'] . '</a></h3>' .
            '<div><ul>';

      foreach ($groups['apps'] as $app) {
		  if(check_admin_group($app['code']))echo '<li><a href="' . $app['link'] . '">' . $app['title'] . '</a></li>';
      }

      echo '</ul></div>';
	 }
    }
?>

 

Share this post


Link to post
Share on other sites
2 minutes ago, Omar_one said:

did you  replaced  (admin/includes/column_left.php)


<?php
    foreach ($cl_box_groups as $groups) {
      echo '<h3><a href="#">' . $groups['heading'] . '</a></h3>' .
           '<div><ul>';

      foreach ($groups['apps'] as $app) {
        echo '<li><a href="' . $app['link'] . '">' . $app['title'] . '</a></li>';
      }

      echo '</ul></div>';
    }
?>

with this one


<?php
    foreach ($cl_box_groups as $groups) {
	 if(display_block_to_admin_group($groups['heading'])){
      echo '<h3><a href="#">' . $groups['heading'] . '</a></h3>' .
            '<div><ul>';

      foreach ($groups['apps'] as $app) {
		  if(check_admin_group($app['code']))echo '<li><a href="' . $app['link'] . '">' . $app['title'] . '</a></li>';
      }

      echo '</ul></div>';
	 }
    }
?>

 

Yeah I did.

If I add this from the top of the column_left.php file into the administrators_group.php file I get the list on the right but the left column doesn't show.

if (tep_session_is_registered('admin')) {
    $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);
      }
    }

    function tep_sort_admin_boxes($a, $b) {
      return strcasecmp($a['heading'], $b['heading']);
    }

    usort($cl_box_groups, 'tep_sort_admin_boxes');

    function tep_sort_admin_boxes_links($a, $b) {
      return strcasecmp($a['title'], $b['title']);
    }

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

 

Share this post


Link to post
Share on other sites

I suspect this is an issue with the bs4 admin I am using, not anything else as I did a fresh install without it and it works.

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

×