Example #1
0
 public static function secFile($filePath, $accessLevel)
 {
     $filePath = strtolower(str_replace('\\', '/', $filePath));
     $page = substr($filePath, strrpos($filePath, '/') + 1, strlen($filePath) - strrpos($filePath, '/') - 5);
     $plug = substr($filePath, strrpos($filePath, '/', -(strlen($page) + 6)) + 1, strrpos($filePath, '/') - strrpos($filePath, '/', -(strlen($page) + 6)) - 1);
     if (self::secThis('core_plugins', self::getPluginId($plug), $accessLevel) || secThis('core_pages', self::getTableId($page), $accessLevel)) {
         return true;
     } else {
         include 'plugins/core/403.php';
         return false;
     }
 }
Example #2
0
              </span>
        </div>
      </form>
      <!-- /.search form -->
      <!-- sidebar menu: : style can be found in sidebar.less -->
      <ul class="sidebar-menu">
        <li class="header"><?php 
echo _('#core#_#2#');
?>
</li>
        <li class="active"><a href="index.php"><i class="fa iconastic-ios-home"></i> <span><?php 
echo _('#core#_#3#');
?>
</span></a></li>
<?php 
if (secThis('core_plugins', getPluginId('core'), 80)) {
    ?>
<li class="treeview">
	<a href="#">
	<i class="icon iconastic-wrench-1"></i>
	<span><?php 
    echo _('#core#_#5#');
    ?>
</span>
	<i class="icon iconastic-angle-left pull-right"></i>
	<!-- <span class="label label-primary pull-right">4</span> -->
	</a>
	<ul class="treeview-menu">
		<li><a href="index.php?g=core&p=admin_users"><i class="icon iconastic-user"></i> <?php 
    echo _('#core#_#6#');
    ?>