mirror of
https://github.com/e107inc/e107.git
synced 2025-07-31 03:40:37 +02:00
getperms() was failing with plugin-only access and other non-mainadmin perms. Fixed.
This commit is contained in:
21
class2.php
21
class2.php
@@ -9,8 +9,8 @@
|
|||||||
* General purpose file
|
* General purpose file
|
||||||
*
|
*
|
||||||
* $Source: /cvs_backup/e107_0.8/class2.php,v $
|
* $Source: /cvs_backup/e107_0.8/class2.php,v $
|
||||||
* $Revision: 1.171 $
|
* $Revision: 1.172 $
|
||||||
* $Date: 2009-12-24 09:59:20 $
|
* $Date: 2009-12-24 10:51:23 $
|
||||||
* $Author: e107coders $
|
* $Author: e107coders $
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@@ -1321,19 +1321,20 @@ function getperms($arg, $ap = ADMINPERMS)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
$ap = '.'.$ap;
|
|
||||||
if ($arg == 'P' && preg_match("#(.*?)/".e107::getInstance()->getFolder('plugins')."(.*?)/(.*?)#", e_SELF, $matches))
|
if ($arg == 'P' && preg_match("#(.*?)/".e107::getInstance()->getFolder('plugins')."(.*?)/(.*?)#", e_SELF, $matches))
|
||||||
{
|
{
|
||||||
$psql = new db;
|
$sql = e107::getDb('psql');
|
||||||
if ($psql->db_Select('plugin', 'plugin_id', "plugin_path = '".$matches[2]."' "))
|
|
||||||
|
if ($sql->db_Select('plugin', 'plugin_id', "plugin_path = '".$matches[2]."' LIMIT 1 "))
|
||||||
{
|
{
|
||||||
$row = $psql->db_Fetch();
|
$row = $sql->db_Fetch();
|
||||||
$arg = 'P'.$row[0];
|
$arg = 'P'.$row['plugin_id'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$ap_array = explode('.',$ap);
|
||||||
|
|
||||||
|
if(in_array($arg,$ap_array))
|
||||||
if (strpos($ap, '.'.$arg.'.') !== false)
|
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -1342,7 +1343,7 @@ function getperms($arg, $ap = ADMINPERMS)
|
|||||||
$tmp = explode("|", $arg);
|
$tmp = explode("|", $arg);
|
||||||
foreach($tmp as $val)
|
foreach($tmp as $val)
|
||||||
{
|
{
|
||||||
if (strpos($ap, '.'.$val.'.') !== false)
|
if(in_array($arg,$ap_array))
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@@ -11,8 +11,8 @@
|
|||||||
| GNU General Public License (http://gnu.org).
|
| GNU General Public License (http://gnu.org).
|
||||||
|
|
|
|
||||||
| $Source: /cvs_backup/e107_0.8/e107_admin/includes/infopanel.php,v $
|
| $Source: /cvs_backup/e107_0.8/e107_admin/includes/infopanel.php,v $
|
||||||
| $Revision: 1.18 $
|
| $Revision: 1.19 $
|
||||||
| $Date: 2009-12-24 10:00:30 $
|
| $Date: 2009-12-24 10:51:23 $
|
||||||
| $Author: e107coders $
|
| $Author: e107coders $
|
||||||
+----------------------------------------------------------------------------+
|
+----------------------------------------------------------------------------+
|
||||||
*/
|
*/
|
||||||
@@ -39,10 +39,11 @@ if (isset($_POST['submit-mye107']) || varset($_POST['submit-mymenus']))
|
|||||||
// ---------------------- Start Panel --------------------------------
|
// ---------------------- Start Panel --------------------------------
|
||||||
|
|
||||||
$text = "<div style='text-align:center'>";
|
$text = "<div style='text-align:center'>";
|
||||||
if (!vartrue($user_pref['core-infopanel-mye107'])) // Set default icons.
|
if (getperms('0') && !vartrue($user_pref['core-infopanel-mye107'])) // Set default icons.
|
||||||
{
|
{
|
||||||
$user_pref['core-infopanel-mye107'] = $pref['core-infopanel-default'];
|
$user_pref['core-infopanel-mye107'] = $pref['core-infopanel-default'];
|
||||||
}
|
}
|
||||||
|
|
||||||
$iconlist = array_merge($array_functions_assoc, getPluginLinks(E_16_PLUGMANAGER, "array"));
|
$iconlist = array_merge($array_functions_assoc, getPluginLinks(E_16_PLUGMANAGER, "array"));
|
||||||
|
|
||||||
$text .= "
|
$text .= "
|
||||||
@@ -62,7 +63,7 @@ if (isset($_POST['submit-mye107']) || varset($_POST['submit-mymenus']))
|
|||||||
// Rendering the saved configuration.
|
// Rendering the saved configuration.
|
||||||
foreach ($iconlist as $key=>$val)
|
foreach ($iconlist as $key=>$val)
|
||||||
{
|
{
|
||||||
if (!isset($user_pref['core-infopanel-mye107']) || in_array($key, $user_pref['core-infopanel-mye107']))
|
if (!vartrue($user_pref['core-infopanel-mye107']) || in_array($key, $user_pref['core-infopanel-mye107']))
|
||||||
{
|
{
|
||||||
$text .= render_links($val['link'], $val['title'], $val['caption'], $val['perms'], $val['icon_32'], "div");
|
$text .= render_links($val['link'], $val['title'], $val['caption'], $val['perms'], $val['icon_32'], "div");
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user