1
0
mirror of https://github.com/e107inc/e107.git synced 2025-07-26 01:11:28 +02:00

Fix for admin language-page perms.

This commit is contained in:
Cameron
2013-11-02 02:21:37 -07:00
parent 388eb63316
commit d318fee88f

@@ -12,7 +12,7 @@
* $Id$ * $Id$
*/ */
require_once ("../class2.php"); require_once ("../class2.php");
if (!getperms('0')) if (!getperms('L'))
{ {
header("location:".e_BASE."index.php"); header("location:".e_BASE."index.php");
exit; exit;
@@ -39,6 +39,7 @@ $lck = new lancheck;
$tabs = table_list(); // array("news","content","links"); $tabs = table_list(); // array("news","content","links");
$lanlist = e107::getLanguage()->installed();// Bugfix - don't use e_LANLIST as it's cached (SESSION) $lanlist = e107::getLanguage()->installed();// Bugfix - don't use e_LANLIST as it's cached (SESSION)
$message = ''; $message = '';
if (e_QUERY) if (e_QUERY)
{ {
$tmp = explode('.', e_QUERY); $tmp = explode('.', e_QUERY);
@@ -47,7 +48,13 @@ if (e_QUERY)
$id = varset($tmp[2]); $id = varset($tmp[2]);
unset($tmp); unset($tmp);
} }
if (isset($_POST['submit_prefs']) && isset($_POST['mainsitelanguage'])) elseif(!getperms('0'))
{
$action = 'tools';
}
if (isset($_POST['submit_prefs']) && isset($_POST['mainsitelanguage']) && getperms('0'))
{ {
unset($temp); unset($temp);
$changes = array(); $changes = array();
@@ -68,7 +75,7 @@ if (isset($_POST['submit_prefs']) && isset($_POST['mainsitelanguage']))
} }
} }
// ----------------- delete tables --------------------------------------------- // ----------------- delete tables ---------------------------------------------
if (isset($_POST['del_existing']) && $_POST['lang_choices']) if (isset($_POST['del_existing']) && $_POST['lang_choices'] && getperms('0'))
{ {
$lang = strtolower($_POST['lang_choices']); $lang = strtolower($_POST['lang_choices']);
foreach ($tabs as $del_table) foreach ($tabs as $del_table)
@@ -631,6 +638,11 @@ require_once (e_ADMIN."footer.php");
function multilang_prefs() function multilang_prefs()
{ {
if(!getperms('0'))
{
return;
}
global $lanlist; global $lanlist;
$pref = e107::getPref(); $pref = e107::getPref();
$mes = e107::getMessage(); $mes = e107::getMessage();
@@ -796,6 +808,12 @@ function table_list()
function multilang_db() function multilang_db()
{ {
if(!getperms('0'))
{
return "Access Denied";
}
global $lanlist, $tabs; global $lanlist, $tabs;
$sql = e107::getDb(); $sql = e107::getDb();
@@ -1342,21 +1360,25 @@ function language_adminmenu()
if ($action == "") if ($action == "")
{ {
$action = "main"; $action = getperms('0') ? "main" : "tools";
} }
if ($action == "modify") if ($action == "modify")
{ {
$action = "db"; $action = "db";
} }
$var['main']['text'] = LAN_PREFS; if(getperms('0'))
$var['main']['link'] = e_SELF;
if (isset($pref['multilanguage']) && $pref['multilanguage'])
{ {
$var['db']['text'] = LANG_LAN_03; $var['main']['text'] = LAN_PREFS;
$var['db']['link'] = e_SELF."?db"; $var['main']['link'] = e_SELF;
if (isset($pref['multilanguage']) && $pref['multilanguage'])
{
$var['db']['text'] = LANG_LAN_03;
$var['db']['link'] = e_SELF."?db";
}
} }
// $lcnt = explode(",", e_LANLIST); // $lcnt = explode(",", e_LANLIST);
// if (count($lcnt) > 1) // if (count($lcnt) > 1)
// { // {