mirror of
https://github.com/e107inc/e107.git
synced 2025-07-27 01:40:22 +02:00
Bugfixes - incorrect admin perms displayed in admin area.
Xml-class was breaking page-load on some systems.
This commit is contained in:
@@ -550,6 +550,8 @@ attribute 7 = 32 x 32 image
|
|||||||
//TODO find out where is used $array_functions elsewhere, refactor it
|
//TODO find out where is used $array_functions elsewhere, refactor it
|
||||||
|
|
||||||
|
|
||||||
|
// DO NOT EDIT without first checking user_handler.php
|
||||||
|
|
||||||
$array_functions = array(
|
$array_functions = array(
|
||||||
0 => array(e_ADMIN.'administrator.php', ADLAN_8, ADLAN_9, '3', 2, E_16_ADMIN, E_32_ADMIN),
|
0 => array(e_ADMIN.'administrator.php', ADLAN_8, ADLAN_9, '3', 2, E_16_ADMIN, E_32_ADMIN),
|
||||||
1 => array(e_ADMIN.'updateadmin.php', ADLAN_10, ADLAN_11, '', 2, E_16_ADPASS, E_32_ADPASS),
|
1 => array(e_ADMIN.'updateadmin.php', ADLAN_10, ADLAN_11, '', 2, E_16_ADPASS, E_32_ADPASS),
|
||||||
|
@@ -869,7 +869,7 @@ class e_userperms
|
|||||||
|
|
||||||
// Tools
|
// Tools
|
||||||
"Y" => array(ADMSLAN_67,E_16_INSPECT, E_32_INSPECT), // File inspector
|
"Y" => array(ADMSLAN_67,E_16_INSPECT, E_32_INSPECT), // File inspector
|
||||||
"9" => array(ADMSLAN_28,E_16_MAINTAIN, E_32_MAINTAIN), // Take Down site for Maintenance
|
"9" => array(ADMSLAN_28, E_16_MAINTAIN, E_32_MAINTAIN), // Take Down site for Maintenance
|
||||||
"O" => array(ADMSLAN_68,E_16_NOTIFY, E_32_NOTIFY), // Notify
|
"O" => array(ADMSLAN_68,E_16_NOTIFY, E_32_NOTIFY), // Notify
|
||||||
"U" => array(ADMSLAN_45,E_16_CRON, E_32_CRON), // Schedule Tasks
|
"U" => array(ADMSLAN_45,E_16_CRON, E_32_CRON), // Schedule Tasks
|
||||||
"S" => array(ADMSLAN_33,E_16_ADMINLOG, E_32_ADMINLOG), // System Logging
|
"S" => array(ADMSLAN_33,E_16_ADMINLOG, E_32_ADMINLOG), // System Logging
|
||||||
@@ -901,6 +901,8 @@ class e_userperms
|
|||||||
protected $language_perms = array();
|
protected $language_perms = array();
|
||||||
|
|
||||||
protected $main_perms = array();
|
protected $main_perms = array();
|
||||||
|
|
||||||
|
protected $full_perms = array();
|
||||||
|
|
||||||
protected $permSectionDiz = array(
|
protected $permSectionDiz = array(
|
||||||
'core' => ADMSLAN_74,
|
'core' => ADMSLAN_74,
|
||||||
@@ -934,16 +936,16 @@ class e_userperms
|
|||||||
|
|
||||||
// echo $plg->getIcon('forum');
|
// echo $plg->getIcon('forum');
|
||||||
|
|
||||||
$sql->db_Select("plugin", "*", "plugin_installflag='1'");
|
// $sql->db_Select("plugin", "*", "plugin_installflag='1'");
|
||||||
while ($row2 = $sql->db_Fetch())
|
// while ($row2 = $sql->db_Fetch())
|
||||||
{
|
// {
|
||||||
// $this->plugin_perms[("P".$row2['plugin_id'])] = array($tp->toHTML($row2['plugin_name'], FALSE, 'RAWTEXT,defs'));
|
// $this->plugin_perms[("P".$row2['plugin_id'])] = array($tp->toHTML($row2['plugin_name'], FALSE, 'RAWTEXT,defs'));
|
||||||
// $this->plugin_perms[("P".$row2['plugin_id'])][1] = $plg->getIcon('forum')
|
// $this->plugin_perms[("P".$row2['plugin_id'])][1] = $plg->getIcon('forum')
|
||||||
}
|
// }
|
||||||
|
|
||||||
asort($this->plugin_perms);
|
asort($this->plugin_perms);
|
||||||
|
|
||||||
$this->plugin_perms = array("Z"=>ADMSLAN_62) + $this->plugin_perms;
|
$this->plugin_perms = array("Z"=> array('0'=>ADMSLAN_62)) + $this->plugin_perms;
|
||||||
|
|
||||||
if(e107::getConfig()->getPref('multilanguage'))
|
if(e107::getConfig()->getPref('multilanguage'))
|
||||||
{
|
{
|
||||||
@@ -951,15 +953,18 @@ class e_userperms
|
|||||||
sort($lanlist);
|
sort($lanlist);
|
||||||
foreach($lanlist as $langs)
|
foreach($lanlist as $langs)
|
||||||
{
|
{
|
||||||
$this->language_perms[$langs] = $langs;
|
$this->language_perms[$langs] = array("0"=>$langs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(getperms('0'))
|
if(getperms('0'))
|
||||||
{
|
{
|
||||||
$this->main_perms = array('0' => ADMSLAN_58);
|
$this->main_perms = array('0' => array('0'=>ADMSLAN_58));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Note: Using array_merge or array_merge_recursive will corrupt the array.
|
||||||
|
$this->full_perms = $this->core_perms + $this->plugin_perms + $this->language_perms + $this->main_perms;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function renderSectionDiz($key)
|
function renderSectionDiz($key)
|
||||||
@@ -1007,7 +1012,7 @@ class e_userperms
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return array_merge($this->core_perms,$this->plugin_perms,$this->language_perms,$this->main_perms);
|
return $this->full_perms;
|
||||||
}
|
}
|
||||||
|
|
||||||
function checkb($arg, $perms, $info='')
|
function checkb($arg, $perms, $info='')
|
||||||
@@ -1041,7 +1046,7 @@ class e_userperms
|
|||||||
$tmp = explode(".",$perms);
|
$tmp = explode(".",$perms);
|
||||||
$permdiz = $this->getPermList();
|
$permdiz = $this->getPermList();
|
||||||
$ptext = array();
|
$ptext = array();
|
||||||
|
|
||||||
foreach($tmp as $p)
|
foreach($tmp as $p)
|
||||||
{
|
{
|
||||||
$ptext[] = is_array($permdiz[$p]) ? $permdiz[$p][0] : $permdiz[$p];
|
$ptext[] = is_array($permdiz[$p]) ? $permdiz[$p][0] : $permdiz[$p];
|
||||||
@@ -1050,11 +1055,11 @@ class e_userperms
|
|||||||
$id = "id_".$uniqueID;
|
$id = "id_".$uniqueID;
|
||||||
|
|
||||||
|
|
||||||
$text = "<div onclick=\"e107Helper.toggle('id_{$id}')\" class='e-pointer' title='".ADMSLAN_71."'>{$perms}</div>";
|
$text = "<div onclick=\"e107Helper.toggle('id_{$id}')\" class='e-pointer' title='".ADMSLAN_71."'>{$perms}</div>\n";
|
||||||
|
|
||||||
if(varset($ptext))
|
if(varset($ptext))
|
||||||
{
|
{
|
||||||
$text .= "<div id='id_{$id}' class='e-hideme'><ul><li>".implode("</li><li>",$ptext)."</li></ul></div>";
|
$text .= "<div id='id_{$id}' class='e-hideme'><ul><li>".implode("</li>\n<li>",$ptext)."</li></ul></div>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@@ -272,7 +272,7 @@ class xmlClass
|
|||||||
$timeout = max($timeout, 3);
|
$timeout = max($timeout, 3);
|
||||||
$address = str_replace(array("\r", "\n", "\t"), '', $address); // May be paranoia, but streaky thought it might be a good idea
|
$address = str_replace(array("\r", "\n", "\t"), '', $address); // May be paranoia, but streaky thought it might be a good idea
|
||||||
// ... and there shouldn't be unprintable characters in the URL anyway
|
// ... and there shouldn't be unprintable characters in the URL anyway
|
||||||
if (function_exists('file_get_contents'))
|
if (function_exists('file_get_contents') && ini_get('allow_url_fopen'))
|
||||||
{
|
{
|
||||||
$old_timeout = e107_ini_set('default_socket_timeout', $timeout);
|
$old_timeout = e107_ini_set('default_socket_timeout', $timeout);
|
||||||
$data = file_get_contents(urldecode($address));
|
$data = file_get_contents(urldecode($address));
|
||||||
|
Reference in New Issue
Block a user